Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Lot Class Reference
Inheritance diagram for Lot:
EClass

Public Member Functions

void SetBaseRoom (Room r)
 
void RefreshData (TraitHouseBoard.Data data)
 
void AddConnectedRooms (Room r2)
 

Public Attributes

int id
 
int height = 2
 
int idRoofStyle
 
int idBGM
 
int heightFix
 
int idRoofTile
 
int idBlock
 
int idRamp
 
int idDeco
 
int idDeco2
 
int colRoof
 
int colBlock
 
int colDeco
 
int colDeco2
 
int decoFix
 
int decoFix2
 
bool reverse
 
bool snow
 
bool altRoof
 
bool fullblock
 
int x
 
int z
 
int mx
 
int mz
 
int mh
 
bool sync
 
bool dirty
 
float realHeight
 
float light
 
Point pointMinX
 
Point pointMaxX
 
TraitHouseBoard board
 

Static Public Attributes

static Lot Void = new Lot()
 
static Dictionary< int, int > roofCount = new Dictionary<int, int>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Static Private Attributes

static int minX
 
static int minZ
 
static int maxX
 
static int maxZ
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 4 of file Lot.cs.

Member Function Documentation

◆ AddConnectedRooms()

void Lot.AddConnectedRooms ( Room  r2)
inline

Definition at line 255 of file Lot.cs.

256 {
257 r2.lot = this;
258 if (r2.x < minX)
259 {
260 minX = r2.x;
261 }
262 if (r2.mx > maxX)
263 {
264 maxX = r2.mx;
265 }
266 if (r2.z < minZ)
267 {
268 minZ = r2.z;
269 }
270 if (r2.mz > maxZ)
271 {
272 maxZ = r2.mz;
273 }
274 if (r2.mh > mh)
275 {
276 mh = r2.mh;
277 }
278 if (r2.pointMinX.x + r2.pointMinX.z < pointMinX.x + pointMinX.z)
279 {
280 pointMinX = r2.pointMinX;
281 }
282 if (r2.pointMaxX.x + r2.pointMaxX.z > pointMaxX.x + pointMaxX.z)
283 {
284 pointMaxX = r2.pointMaxX;
285 }
286 if (board == null)
287 {
288 foreach (Point point in r2.points)
289 {
290 TraitHouseBoard installed = point.GetInstalled<TraitHouseBoard>();
291 if (installed != null)
292 {
294 break;
295 }
296 }
297 }
298 foreach (Room item in EClass._map.rooms.listRoom)
299 {
300 if (item.lot != null)
301 {
302 continue;
303 }
304 bool flag = false;
305 foreach (Point point2 in item.points)
306 {
307 foreach (Point point3 in r2.points)
308 {
309 if (point3.Distance(point2) == 1 && r2.data.group == item.data.group)
310 {
312 flag = true;
313 break;
314 }
315 }
316 if (flag)
317 {
318 break;
319 }
320 }
321 }
322 }
PointList points
Definition: BaseArea.cs:26
Definition: EClass.cs:5
static Map _map
Definition: EClass.cs:18
void AddConnectedRooms(Room r2)
Definition: Lot.cs:255
static int maxX
Definition: Lot.cs:76
static int minX
Definition: Lot.cs:72
TraitHouseBoard board
Definition: Lot.cs:80
static int maxZ
Definition: Lot.cs:78
int mh
Definition: Lot.cs:58
Point pointMinX
Definition: Lot.cs:68
Point pointMaxX
Definition: Lot.cs:70
static int minZ
Definition: Lot.cs:74
RoomManager rooms
Definition: Map.cs:31
Definition: Point.cs:9
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
int Distance(Point p)
Definition: Point.cs:953
List< Room > listRoom
Definition: RoomManager.cs:13
Definition: Room.cs:4
Point pointMaxX
Definition: Room.cs:25
int x
Definition: Room.cs:5
int z
Definition: Room.cs:7
int mx
Definition: Room.cs:9
Point pointMinX
Definition: Room.cs:23
int mh
Definition: Room.cs:13
int mz
Definition: Room.cs:11

References EClass._map, AddConnectedRooms(), board, Point.Distance(), installed, item, RoomManager.listRoom, maxX, maxZ, mh, Room.mh, minX, minZ, Room.mx, Room.mz, pointMaxX, Room.pointMaxX, pointMinX, Room.pointMinX, BaseArea.points, Map.rooms, Point.x, Room.x, Point.z, and Room.z.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ RefreshData()

void Lot.RefreshData ( TraitHouseBoard::Data  data)
inline

Definition at line 212 of file Lot.cs.

213 {
214 if (data.colRoof == 0)
215 {
216 data.colRoof = IntColor.ToInt(EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f));
217 }
218 if (data.colBlock == 0)
219 {
220 data.colBlock = IntColor.ToInt(EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f));
221 }
222 if (data.colDeco == 0)
223 {
224 data.colDeco = IntColor.ToInt(EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f));
225 }
226 if (data.colDeco2 == 0)
227 {
228 data.colDeco2 = IntColor.ToInt(EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f));
229 }
230 height = data.height;
231 reverse = data.reverse;
232 altRoof = data.altRoof;
233 snow = data.snow;
235 idRoofTile = data.idRoofTile;
236 idBlock = data.idBlock;
237 idRamp = data.idRamp;
238 idBGM = data.idBGM;
239 idDeco = data.idDeco;
240 idDeco2 = data.idDeco2;
241 heightFix = data.heightFix;
242 decoFix = data.decoFix;
243 decoFix2 = data.decoFix2;
244 realHeight = (float)height * EClass.setting.render.roomHeightMod + 0.01f * (float)heightFix;
245 Color matColor = IntColor.FromInt(data.colRoof);
246 Color matColor2 = IntColor.FromInt(data.colBlock);
247 Color matColor3 = IntColor.FromInt(data.colDeco);
248 Color matColor4 = IntColor.FromInt(data.colDeco2);
249 colRoof = BaseTileMap.GetColorInt(ref matColor, 100);
250 colBlock = BaseTileMap.GetColorInt(ref matColor2, 100);
251 colDeco = BaseTileMap.GetColorInt(ref matColor3, 100);
252 colDeco2 = BaseTileMap.GetColorInt(ref matColor4, 100);
253 }
static int GetColorInt(ref Color matColor, int p)
static SourceManager sources
Definition: EClass.cs:42
static GameSetting setting
Definition: EClass.cs:34
RenderSetting render
Definition: GameSetting.cs:301
static int ToInt(ref Color c)
Definition: IntColor.cs:24
static Color32 FromInt(int i)
Definition: IntColor.cs:15
int colDeco2
Definition: Lot.cs:36
bool altRoof
Definition: Lot.cs:46
int colBlock
Definition: Lot.cs:32
int decoFix
Definition: Lot.cs:38
bool snow
Definition: Lot.cs:44
int idRamp
Definition: Lot.cs:24
int decoFix2
Definition: Lot.cs:40
int colRoof
Definition: Lot.cs:30
int colDeco
Definition: Lot.cs:34
int idRoofStyle
Definition: Lot.cs:14
int heightFix
Definition: Lot.cs:18
float realHeight
Definition: Lot.cs:64
int idBlock
Definition: Lot.cs:22
int height
Definition: Lot.cs:12
int idDeco2
Definition: Lot.cs:28
int idDeco
Definition: Lot.cs:26
int idRoofTile
Definition: Lot.cs:20
bool reverse
Definition: Lot.cs:42
int idBGM
Definition: Lot.cs:16
SourceMaterial materials

References altRoof, colBlock, colDeco, colDeco2, Color, colRoof, decoFix, decoFix2, IntColor.FromInt(), BaseTileMap.GetColorInt(), height, heightFix, idBGM, idBlock, idDeco, idDeco2, idRamp, idRoofStyle, idRoofTile, SourceManager.materials, realHeight, GameSetting.render, reverse, GameSetting.RenderSetting.roomHeightMod, EClass.setting, snow, EClass.sources, and IntColor.ToInt().

Referenced by TraitHouseBoard.ApplyData(), and SetBaseRoom().

◆ SetBaseRoom()

void Lot.SetBaseRoom ( Room  r)
inline

Definition at line 82 of file Lot.cs.

83 {
84 board = null;
85 fullblock = false;
86 minX = r.x;
87 maxX = r.mx;
88 minZ = r.z;
89 maxZ = r.mz;
90 mh = r.mh;
94 x = minX;
95 mx = maxX;
96 z = minZ;
97 mz = maxZ;
98 bool flag = false;
99 roofCount.Clear();
100 foreach (Room item in EClass._map.rooms.listRoom)
101 {
102 if (item.lot != this)
103 {
104 continue;
105 }
106 if (item.roof)
107 {
108 flag = true;
109 }
110 if (item.fullblock)
111 {
112 fullblock = true;
113 }
114 foreach (KeyValuePair<int, int> item2 in item.roofCount)
115 {
116 if (!roofCount.ContainsKey(item2.Key))
117 {
118 roofCount[item2.Key] = 0;
119 }
120 roofCount[item2.Key] += item2.Value;
121 }
122 }
123 int num = 0;
124 int num2 = 0;
125 foreach (KeyValuePair<int, int> item3 in roofCount)
126 {
127 if (item3.Value > num)
128 {
129 num = item3.Value;
130 num2 = item3.Key;
131 }
132 }
133 if (board != null)
134 {
135 if (board.data == null)
136 {
137 TraitHouseBoard.Data data2 = (board.data = new TraitHouseBoard.Data());
138 CoreRef.DefaultRoof defaultRoof = EClass.core.refs.defaultRoofs[EClass.sources.blocks.map[num2 / 1000].roof];
139 data2.height = (fullblock ? 1 : 2);
140 data2.heightFix = (fullblock ? 40 : 0);
141 data2.reverse = EClass.rnd(2) == 0;
142 data2.idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);
143 data2.idBlock = defaultRoof.idBlock;
144 data2.idRamp = defaultRoof.idRamp;
145 SourceMaterial.Row row = EClass.sources.materials.map[num2 % 1000];
146 data2.colRoof = IntColor.ToInt(row.matColor);
147 }
149 }
150 else
151 {
152 CoreRef.DefaultRoof defaultRoof2 = EClass.core.refs.defaultRoofs[EClass.sources.blocks.map[num2 / 1000].roof];
153 height = (fullblock ? 1 : 2);
154 heightFix = (fullblock ? 40 : 0);
155 idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);
156 idBlock = defaultRoof2.idBlock;
157 idRamp = defaultRoof2.idRamp;
158 realHeight = (float)height * EClass.setting.render.roomHeightMod + 0.01f * (float)heightFix;
159 Color matColor = EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f);
160 colRoof = (colBlock = (colDeco = BaseTileMap.GetColorInt(ref matColor, 100)));
161 SourceMaterial.Row row2 = EClass.sources.materials.map[num2 % 1000];
162 colRoof = BaseTileMap.GetColorInt(ref row2.matColor, 100);
163 }
164 int num3 = (mx - x + pointMinX.z - z) / 2;
165 int num4 = pointMaxX.x - pointMinX.x + pointMaxX.z - pointMinX.z + 1;
166 int num5 = (mx - x + mz - z) / 2 + 4;
167 int num6 = pointMinX.x + num3 - num5;
168 int num7 = pointMinX.z - num3 + num5;
169 int num8 = 0;
170 for (int i = 0; i < num4; i++)
171 {
172 int num9 = num6;
173 int num10 = num7;
174 bool flag2 = false;
175 for (int j = 0; j < num5 + 1; j++)
176 {
177 if (num10 < num8 - 1 || num9 < 0 || num10 < 0 || num9 >= EClass._map.Size || num10 >= EClass._map.Size)
178 {
179 num9++;
180 num10--;
181 continue;
182 }
183 Cell cell = EClass._map.cells[num9, num10];
184 if (flag2 && (cell.room?.lot != this || (!cell.HasFullBlock && !cell.HasWall)))
185 {
186 break;
187 }
188 if (cell.room?.lot == this)
189 {
190 cell.lotWall = true;
191 if (!flag2 && !cell.HasFullBlock && !cell.HasWall)
192 {
193 break;
194 }
195 flag2 = true;
196 num8 = num10;
197 }
198 num9++;
199 num10--;
200 }
201 if (i % 2 == 0)
202 {
203 num6++;
204 }
205 else
206 {
207 num7++;
208 }
209 }
210 }
Definition: Cell.cs:7
Room room
Definition: Cell.cs:102
bool HasWall
Definition: Cell.cs:833
bool HasFullBlock
Definition: Cell.cs:817
List< DefaultRoof > defaultRoofs
Definition: CoreRef.cs:367
CoreRef refs
Definition: Core.cs:51
static int rnd(int a)
Definition: EClass.cs:50
static Core core
Definition: EClass.cs:6
static Dictionary< int, int > roofCount
Definition: Lot.cs:8
int x
Definition: Lot.cs:50
void RefreshData(TraitHouseBoard.Data data)
Definition: Lot.cs:212
int z
Definition: Lot.cs:52
int mx
Definition: Lot.cs:54
bool fullblock
Definition: Lot.cs:48
int mz
Definition: Lot.cs:56
int Size
Definition: MapBounds.cs:20
Cell[,] cells
Definition: Map.cs:85
Lot lot
Definition: Room.cs:21
SourceBlock blocks

References EClass._map, AddConnectedRooms(), SourceManager.blocks, board, Map.cells, colBlock, colDeco, Color, colRoof, EClass.core, TraitHouseBoard.data, CoreRef.defaultRoofs, fullblock, BaseTileMap.GetColorInt(), Cell.HasFullBlock, Cell.HasWall, height, heightFix, CoreRef.DefaultRoof.idBlock, idBlock, CoreRef.DefaultRoof.idRamp, idRamp, idRoofStyle, item, RoomManager.listRoom, Room.lot, SourceMaterial.Row.matColor, SourceManager.materials, maxX, maxZ, mh, Room.mh, minX, minZ, mx, Room.mx, mz, Room.mz, pointMaxX, Room.pointMaxX, pointMinX, Room.pointMinX, realHeight, RefreshData(), Core.refs, GameSetting.render, EClass.rnd(), roofCount, Cell.room, GameSetting.RenderSetting.roomHeightMod, Map.rooms, EClass.setting, MapBounds.Size, EClass.sources, IntColor.ToInt(), x, Room.x, z, and Room.z.

Referenced by RoomManager.RebuildLots().

Member Data Documentation

◆ altRoof

bool Lot.altRoof

Definition at line 46 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), and RefreshData().

◆ board

TraitHouseBoard Lot.board

Definition at line 80 of file Lot.cs.

Referenced by AddConnectedRooms(), SetBaseRoom(), and TraitHouseBoard.TrySetAct().

◆ colBlock

int Lot.colBlock

Definition at line 32 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), RefreshData(), and SetBaseRoom().

◆ colDeco

int Lot.colDeco

Definition at line 34 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), RefreshData(), and SetBaseRoom().

◆ colDeco2

int Lot.colDeco2

Definition at line 36 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), and RefreshData().

◆ colRoof

int Lot.colRoof

Definition at line 30 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), RefreshData(), and SetBaseRoom().

◆ decoFix

int Lot.decoFix

Definition at line 38 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), and RefreshData().

◆ decoFix2

int Lot.decoFix2

Definition at line 40 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), and RefreshData().

◆ dirty

bool Lot.dirty

Definition at line 62 of file Lot.cs.

◆ fullblock

bool Lot.fullblock

Definition at line 48 of file Lot.cs.

Referenced by SetBaseRoom().

◆ height

int Lot.height = 2

◆ heightFix

int Lot.heightFix

Definition at line 18 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), BaseTileMap.DrawTile(), RefreshData(), and SetBaseRoom().

◆ id

int Lot.id

Definition at line 10 of file Lot.cs.

◆ idBGM

int Lot.idBGM

Definition at line 16 of file Lot.cs.

Referenced by BaseTileMap.Draw(), TileMapElona.Draw(), Zone.RefreshBGM(), and RefreshData().

◆ idBlock

int Lot.idBlock

Definition at line 22 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), RefreshData(), and SetBaseRoom().

◆ idDeco

int Lot.idDeco

Definition at line 26 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), and RefreshData().

◆ idDeco2

int Lot.idDeco2

Definition at line 28 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), and RefreshData().

◆ idRamp

int Lot.idRamp

Definition at line 24 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), RefreshData(), and SetBaseRoom().

◆ idRoofStyle

◆ idRoofTile

int Lot.idRoofTile

Definition at line 20 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), and RefreshData().

◆ light

float Lot.light

Definition at line 66 of file Lot.cs.

Referenced by BaseTileMap.DrawTile(), and BaseTileMap.GetRoofLight().

◆ maxX

int Lot.maxX
staticprivate

Definition at line 76 of file Lot.cs.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ maxZ

int Lot.maxZ
staticprivate

Definition at line 78 of file Lot.cs.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ mh

◆ minX

int Lot.minX
staticprivate

Definition at line 72 of file Lot.cs.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ minZ

int Lot.minZ
staticprivate

Definition at line 74 of file Lot.cs.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ mx

int Lot.mx

Definition at line 54 of file Lot.cs.

Referenced by SetBaseRoom().

◆ mz

int Lot.mz

Definition at line 56 of file Lot.cs.

Referenced by SetBaseRoom().

◆ pointMaxX

Point Lot.pointMaxX

Definition at line 70 of file Lot.cs.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ pointMinX

Point Lot.pointMinX

Definition at line 68 of file Lot.cs.

Referenced by AddConnectedRooms(), and SetBaseRoom().

◆ realHeight

◆ reverse

bool Lot.reverse

Definition at line 42 of file Lot.cs.

Referenced by BaseTileMap.DrawRoof(), and RefreshData().

◆ roofCount

Dictionary<int, int> Lot.roofCount = new Dictionary<int, int>()
static

Definition at line 8 of file Lot.cs.

Referenced by SetBaseRoom().

◆ snow

bool Lot.snow

Definition at line 44 of file Lot.cs.

Referenced by RefreshData().

◆ sync

bool Lot.sync

Definition at line 60 of file Lot.cs.

◆ Void

Lot Lot.Void = new Lot()
static

Definition at line 6 of file Lot.cs.

Referenced by Room.AddPoint().

◆ x

int Lot.x

Definition at line 50 of file Lot.cs.

Referenced by SetBaseRoom().

◆ z

int Lot.z

Definition at line 52 of file Lot.cs.

Referenced by SetBaseRoom().


The documentation for this class was generated from the following file: