aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Neighbours.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Neighbours.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Neighbours.cs136
1 files changed, 0 insertions, 136 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Neighbours.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Neighbours.cs
deleted file mode 100644
index d1027a3..0000000
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Neighbours.cs
+++ /dev/null
@@ -1,136 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28namespace libTerrain
29{
30 partial class Channel
31 {
32 private enum NeighbourSystem
33 {
34 Moore,
35 VonNeumann
36 } ;
37
38 private int[] Neighbours(NeighbourSystem type, int index)
39 {
40 int[] coord = new int[2];
41
42 index++;
43
44 switch (type)
45 {
46 case NeighbourSystem.Moore:
47 switch (index)
48 {
49 case 1:
50 coord[0] = -1;
51 coord[1] = -1;
52 break;
53
54 case 2:
55 coord[0] = -0;
56 coord[1] = -1;
57 break;
58
59 case 3:
60 coord[0] = +1;
61 coord[1] = -1;
62 break;
63
64 case 4:
65 coord[0] = -1;
66 coord[1] = -0;
67 break;
68
69 case 5:
70 coord[0] = -0;
71 coord[1] = -0;
72 break;
73
74 case 6:
75 coord[0] = +1;
76 coord[1] = -0;
77 break;
78
79 case 7:
80 coord[0] = -1;
81 coord[1] = +1;
82 break;
83
84 case 8:
85 coord[0] = -0;
86 coord[1] = +1;
87 break;
88
89 case 9:
90 coord[0] = +1;
91 coord[1] = +1;
92 break;
93
94 default:
95 break;
96 }
97 break;
98
99 case NeighbourSystem.VonNeumann:
100 switch (index)
101 {
102 case 1:
103 coord[0] = 0;
104 coord[1] = -1;
105 break;
106
107 case 2:
108 coord[0] = -1;
109 coord[1] = 0;
110 break;
111
112 case 3:
113 coord[0] = +1;
114 coord[1] = 0;
115 break;
116
117 case 4:
118 coord[0] = 0;
119 coord[1] = +1;
120 break;
121
122 case 5:
123 coord[0] = -0;
124 coord[1] = -0;
125 break;
126
127 default:
128 break;
129 }
130 break;
131 }
132
133 return coord;
134 }
135 }
136}