13 return this.lot.idRoofStyle != 0;
18 public override string ToString()
20 return this.uid.ToString() ??
"";
26 foreach (
Point point
in this.points)
28 point.cell.room =
this;
30 EClass._map.rooms.mapIDs[this.uid] =
this;
35 public void AddPoint(
Point p)
44 public void OnRemove()
47 for (
int i = this.points.Count - 1; i >= 0; i--)
49 this.points[i].cell.room =
null;
52 EClass._map.rooms.dirtyLots =
true;
65 this.roofCount.Clear();
66 this.x = (this.mx = this.points[0].x);
67 this.z = (this.mz = this.points[0].z);
73 this.pointMinX = this.points[0];
74 this.pointMaxX = this.points[0];
75 foreach (
Point point
in this.points)
77 Cell cell = point.cell;
82 else if (point.x >
this.mx)
90 else if (point.z >
this.mz)
94 if (point.x + point.z <
this.pointMinX.x +
this.pointMinX.z)
96 this.pointMinX = point;
98 if (point.x + point.z >
this.pointMaxX.x +
this.pointMaxX.z)
100 this.pointMaxX = point;
102 bool hasFullBlockOrWallOrFence = cell.HasFullBlockOrWallOrFence;
103 if ((
int)cell.TopHeight >
this.mh && hasFullBlockOrWallOrFence)
105 this.mh = (int)cell.TopHeight;
107 if (hasFullBlockOrWallOrFence)
109 TileType tileType = point.sourceBlock.tileType;
114 else if (tileType.IsFence)
122 int num5 = point.sourceBlock.id * 1000 + point.matBlock.id;
123 if (!this.roofCount.ContainsKey(num5))
125 this.roofCount[num5] = 0;
127 Dictionary<int, int> dictionary = this.roofCount;
129 int num6 = dictionary[key];
130 dictionary[key] = num6 + 1;
132 if (this.plate ==
null)
136 num4 += point.x + point.z * 256;
137 cell.fullWall =
false;
138 cell.lotWall =
false;
140 int num7 = (this.mx - this.x + this.pointMinX.z - this.z) / 2;
141 int num8 = this.pointMaxX.x - this.pointMinX.x + this.pointMaxX.z - this.pointMinX.z + 1;
142 int num9 = (this.mx - this.x + this.mz - this.z) / 2 + 2;
143 int num10 = this.pointMinX.x + num7 - num9;
144 int num11 = this.pointMinX.z - num7 + num9;
146 for (
int i = 0; i < num8; i++)
151 for (
int j = 0; j < num9 + 1; j++)
153 if (num14 >= num12 - 1 && num13 >= 0 && num14 >= 0 && num13 <
EClass._map.Size && num14 <
EClass._map.Size)
156 if (flag && (cell2.room !=
this || (!cell2.HasFullBlock && !cell2.HasWall)))
160 if (cell2.room ==
this)
162 cell2.fullWall =
true;
163 if (!flag && !cell2.HasFullBlock && !cell2.HasWall)
183 this.fullblock = (num > num3);
184 this.roof = ((this.mx - this.x + (this.mz - this.z)) / 2 > num2);
186 EClass._map.rooms.dirtyLots =
true;
191 base.SetRandomName(num4);
192 if (this.plate !=
null)
194 this.data.name = this.plate.areaData.name;
195 if (this.plate.areaData.type !=
null)
197 this.type = this.plate.areaData.type;
199 this.data.group = this.plate.areaData.group;
200 this.data.atrium = this.plate.areaData.atrium;
205 public void SetDirty()
208 EClass._map.rooms.dirtyRooms =
true;
233 public bool fullblock;
239 public Point pointMinX;
242 public Point pointMaxX;
245 public Dictionary<int, int> roofCount =
new Dictionary<int, int>();