9 public void SetBaseRoom(
Room r)
12 this.fullblock =
false;
18 this.pointMinX = r.pointMinX;
19 this.pointMaxX = r.pointMaxX;
20 this.AddConnectedRooms(r);
26 Lot.roofCount.Clear();
27 foreach (
Room room
in EClass._map.rooms.listRoom)
37 this.fullblock =
true;
39 foreach (KeyValuePair<int, int> keyValuePair
in room.roofCount)
41 if (!
Lot.roofCount.ContainsKey(keyValuePair.Key))
43 Lot.roofCount[keyValuePair.Key] = 0;
45 Dictionary<int, int> dictionary =
Lot.roofCount;
46 int key = keyValuePair.Key;
47 dictionary[key] += keyValuePair.Value;
53 foreach (KeyValuePair<int, int> keyValuePair2
in Lot.roofCount)
55 if (keyValuePair2.Value > num)
57 num = keyValuePair2.Value;
58 num2 = keyValuePair2.Key;
61 if (this.board !=
null)
63 if (this.board.data ==
null)
67 data.height = (this.fullblock ? 1 : 2);
68 data.heightFix = (this.fullblock ? 40 : 0);
69 data.reverse = (
EClass.rnd(2) == 0);
70 data.idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);
71 data.idBlock = defaultRoof.idBlock;
72 data.idRamp = defaultRoof.idRamp;
74 data.colRoof = IntColor.ToInt(row.matColor);
76 this.RefreshData(this.board.data);
81 this.height = (this.fullblock ? 1 : 2);
82 this.heightFix = (this.fullblock ? 40 : 0);
83 this.idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);
84 this.idBlock = defaultRoof2.idBlock;
85 this.idRamp = defaultRoof2.idRamp;
86 this.realHeight = (float)this.height *
EClass.setting.render.roomHeightMod + 0.01f * (
float)this.heightFix;
87 Color color =
EClass.sources.materials.alias[
"oak"].matColor.SetAlpha(1f);
88 this.colRoof = (this.colBlock = (this.colDeco =
BaseTileMap.GetColorInt(ref color, 100)));
90 this.colRoof =
BaseTileMap.GetColorInt(ref row2.matColor, 100);
92 int num3 = (this.mx - this.x + this.pointMinX.z - this.z) / 2;
93 int num4 = this.pointMaxX.x - this.pointMinX.x + this.pointMaxX.z - this.pointMinX.z + 1;
94 int num5 = (this.mx - this.x + this.mz - this.z) / 2 + 2;
95 int num6 = this.pointMinX.x + num3 - num5;
96 int num7 = this.pointMinX.z - num3 + num5;
98 for (
int i = 0; i < num4; i++)
103 for (
int j = 0; j < num5 + 1; j++)
105 if (num10 >= num8 - 1 && num9 >= 0 && num10 >= 0 && num9 <
EClass._map.Size && num10 <
EClass._map.Size)
110 Room room2 = cell.room;
111 if (((room2 !=
null) ? room2.lot :
null) !=
this || (!cell.HasFullBlock && !cell.HasWall))
116 Room room3 = cell.room;
117 if (((room3 !=
null) ? room3.lot :
null) ==
this)
120 if (!flag2 && !cell.HasFullBlock && !cell.HasWall)
145 if (data.colRoof == 0)
147 data.colRoof = IntColor.ToInt(
EClass.sources.materials.alias[
"oak"].matColor.SetAlpha(1f));
149 if (data.colBlock == 0)
151 data.colBlock = IntColor.ToInt(
EClass.sources.materials.alias[
"oak"].matColor.SetAlpha(1f));
153 if (data.colDeco == 0)
155 data.colDeco = IntColor.ToInt(
EClass.sources.materials.alias[
"oak"].matColor.SetAlpha(1f));
157 if (data.colDeco2 == 0)
159 data.colDeco2 = IntColor.ToInt(
EClass.sources.materials.alias[
"oak"].matColor.SetAlpha(1f));
161 this.height = data.height;
162 this.reverse = data.reverse;
163 this.altRoof = data.altRoof;
164 this.snow = data.snow;
165 this.idRoofStyle = data.idRoofStyle;
166 this.idRoofTile = data.idRoofTile;
167 this.idBlock = data.idBlock;
168 this.idRamp = data.idRamp;
169 this.idBGM = data.idBGM;
170 this.idDeco = data.idDeco;
171 this.idDeco2 = data.idDeco2;
172 this.heightFix = data.heightFix;
173 this.decoFix = data.decoFix;
174 this.decoFix2 = data.decoFix2;
175 this.realHeight = (float)this.height *
EClass.setting.render.roomHeightMod + 0.01f * (
float)this.heightFix;
176 Color color = IntColor.FromInt(data.colRoof);
177 Color color2 = IntColor.FromInt(data.colBlock);
178 Color color3 = IntColor.FromInt(data.colDeco);
179 Color color4 = IntColor.FromInt(data.colDeco2);
180 this.colRoof =
BaseTileMap.GetColorInt(ref color, 100);
181 this.colBlock =
BaseTileMap.GetColorInt(ref color2, 100);
182 this.colDeco =
BaseTileMap.GetColorInt(ref color3, 100);
183 this.colDeco2 =
BaseTileMap.GetColorInt(ref color4, 100);
187 public void AddConnectedRooms(
Room r2)
194 if (r2.mx >
Lot.maxX)
202 if (r2.mz >
Lot.maxZ)
210 if (r2.pointMinX.x + r2.pointMinX.z <
this.pointMinX.x +
this.pointMinX.z)
212 this.pointMinX = r2.pointMinX;
214 if (r2.pointMaxX.x + r2.pointMaxX.z >
this.pointMaxX.x +
this.pointMaxX.z)
216 this.pointMaxX = r2.pointMaxX;
218 if (this.board ==
null)
220 foreach (
Point point
in r2.points)
223 if (installed !=
null)
225 this.board = installed;
230 foreach (
Room room
in EClass._map.rooms.listRoom)
232 if (room.lot ==
null)
235 foreach (
Point p
in room.points)
237 using (List<Point>.Enumerator enumerator3 = r2.points.GetEnumerator())
239 while (enumerator3.MoveNext())
241 if (enumerator3.Current.Distance(p) == 1 && r2.data.group == room.data.group)
243 this.AddConnectedRooms(room);
259 public static Lot Void =
new Lot();
262 public static Dictionary<int, int> roofCount =
new Dictionary<int, int>();
268 public int height = 2;
271 public int idRoofStyle;
277 public int heightFix;
280 public int idRoofTile;
322 public bool fullblock;
346 public float realHeight;
352 public Point pointMinX;
355 public Point pointMaxX;
358 private static int minX;
361 private static int minZ;
364 private static int maxX;
367 private static int maxZ;