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

Public Member Functions

override string ToString ()
 
void OnLoad ()
 
void AddPoint (Point p)
 
void OnRemove ()
 
void Clean ()
 
void Refresh ()
 
void SetDirty ()
 
- Public Member Functions inherited from BaseArea
Point GetRandomFreePos ()
 
Thing GetEmptySeat ()
 
virtual Point GetRandomPoint (bool walkable=true, bool allowChara=true)
 
void ChangeType (string _id)
 
void SetRandomName (int seed=-1)
 
string GetRandomName (int seed=-1)
 
HashSet< string > ListRoomNames ()
 
int GetSortVal (UIList.SortMode m)
 
List< InteractionListInteractions ()
 
void OnInspect ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

Public Attributes

int x
 
int z
 
int mx
 
int mz
 
int mh
 
bool dirty
 
bool roof
 
bool fullblock
 
Lot lot
 
Point pointMinX
 
Point pointMaxX
 
Dictionary< int, int > roofCount = new Dictionary<int, int>()
 
- Public Attributes inherited from BaseArea
int uid
 
PointList points = new PointList()
 
AreaData data = new AreaData()
 
AreaType type = new AreaTypeRoom()
 
TraitRoomPlate plate
 

Properties

bool HasRoof [get]
 
- Properties inherited from BaseArea
virtual string Name [get]
 
bool IsPrivate [get]
 
SourceArea.Row source [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- 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]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Additional Inherited Members

- Public Types inherited from BaseArea
enum  AccessType { Public , Resident , Private }
 
- Public Types inherited from IInspect
enum  NoteMode { Default , Recipe , Product , Info }
 
- 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)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 3 of file Room.cs.

Member Function Documentation

◆ AddPoint()

void Room.AddPoint ( Point  p)
inline

Definition at line 46 of file Room.cs.

47 {
48 points.Add(p);
49 p.cell.room = this;
50 lot = Lot.Void;
51 SetDirty();
52 }
PointList points
Definition: BaseArea.cs:26
Definition: Lot.cs:5
static Lot Void
Definition: Lot.cs:6
void SetDirty()
Definition: Room.cs:213
Lot lot
Definition: Room.cs:21

References lot, BaseArea.points, SetDirty(), and Lot.Void.

◆ Clean()

void Room.Clean ( )
inline

Definition at line 65 of file Room.cs.

66 {
67 plate = null;
68 }
TraitRoomPlate plate
Definition: BaseArea.cs:34

References BaseArea.plate.

Referenced by OnRemove(), and Refresh().

◆ OnLoad()

void Room.OnLoad ( )
inline

Definition at line 36 of file Room.cs.

37 {
38 foreach (Point point in points)
39 {
40 point.cell.room = this;
41 }
42 EClass._map.rooms.mapIDs[uid] = this;
43 SetDirty();
44 }
int uid
Definition: BaseArea.cs:23
Definition: EClass.cs:5
static Map _map
Definition: EClass.cs:18
RoomManager rooms
Definition: Map.cs:31
Definition: Point.cs:9
Dictionary< int, BaseArea > mapIDs
Definition: RoomManager.cs:18

References EClass._map, RoomManager.mapIDs, BaseArea.points, Map.rooms, SetDirty(), and BaseArea.uid.

Referenced by RoomManager.OnLoad().

◆ OnRemove()

void Room.OnRemove ( )
inline

Definition at line 54 of file Room.cs.

55 {
56 Clean();
57 for (int num = points.Count - 1; num >= 0; num--)
58 {
59 points[num].cell.room = null;
60 }
61 points.Clear();
62 EClass._map.rooms.dirtyLots = true;
63 }
void Clean()
Definition: Room.cs:65

References Clean(), and BaseArea.points.

Referenced by RoomManager.RemoveRoom().

◆ Refresh()

void Room.Refresh ( )
inline

Definition at line 70 of file Room.cs.

71 {
72 Clean();
73 roofCount.Clear();
74 x = (mx = points[0].x);
75 z = (mz = points[0].z);
76 mh = 0;
77 int num = 0;
78 int num2 = 0;
79 int num3 = 0;
80 int num4 = 0;
81 pointMinX = points[0];
82 pointMaxX = points[0];
83 foreach (Point point in points)
84 {
85 Cell cell = point.cell;
86 if (point.x < x)
87 {
88 x = point.x;
89 }
90 else if (point.x > mx)
91 {
92 mx = point.x;
93 }
94 if (point.z < z)
95 {
96 z = point.z;
97 }
98 else if (point.z > mz)
99 {
100 mz = point.z;
101 }
102 if (point.x + point.z < pointMinX.x + pointMinX.z)
103 {
104 pointMinX = point;
105 }
106 if (point.x + point.z > pointMaxX.x + pointMaxX.z)
107 {
108 pointMaxX = point;
109 }
110 bool hasFullBlockOrWallOrFence = cell.HasFullBlockOrWallOrFence;
111 if (cell.TopHeight > mh && hasFullBlockOrWallOrFence)
112 {
113 mh = cell.TopHeight;
114 }
115 if (hasFullBlockOrWallOrFence)
116 {
117 TileType tileType = point.sourceBlock.tileType;
118 if (tileType.IsWall)
119 {
120 num3++;
121 }
122 else if (tileType.IsFence)
123 {
124 num2++;
125 }
126 else
127 {
128 num++;
129 }
130 int key = point.sourceBlock.id * 1000 + point.matBlock.id;
131 if (!roofCount.ContainsKey(key))
132 {
133 roofCount[key] = 0;
134 }
135 roofCount[key]++;
136 }
137 if (plate == null)
138 {
139 plate = point.GetInstalled<TraitRoomPlate>();
140 }
141 num4 += point.x + point.z * 256;
142 cell.fullWall = false;
143 cell.lotWall = false;
144 }
145 int num5 = (mx - x + pointMinX.z - z) / 2;
146 int num6 = pointMaxX.x - pointMinX.x + pointMaxX.z - pointMinX.z + 1;
147 int num7 = (mx - x + mz - z) / 2 + 2;
148 int num8 = pointMinX.x + num5 - num7;
149 int num9 = pointMinX.z - num5 + num7;
150 int num10 = 0;
151 for (int i = 0; i < num6; i++)
152 {
153 int num11 = num8;
154 int num12 = num9;
155 bool flag = false;
156 for (int j = 0; j < num7 + 1; j++)
157 {
158 if (num12 < num10 - 1 || num11 < 0 || num12 < 0 || num11 >= EClass._map.Size || num12 >= EClass._map.Size)
159 {
160 num11++;
161 num12--;
162 continue;
163 }
164 Cell cell2 = EClass._map.cells[num11, num12];
165 if (flag && (cell2.room != this || (!cell2.HasFullBlock && !cell2.HasWall)))
166 {
167 break;
168 }
169 if (cell2.room == this)
170 {
171 cell2.fullWall = true;
172 if (!flag && !cell2.HasFullBlock && !cell2.HasWall)
173 {
174 break;
175 }
176 flag = true;
177 num10 = num12;
178 }
179 num11++;
180 num12--;
181 }
182 if (i % 2 == 0)
183 {
184 num8++;
185 }
186 else
187 {
188 num9++;
189 }
190 }
191 fullblock = num > num3;
192 roof = (mx - x + (mz - z)) / 2 > num2;
193 dirty = false;
194 EClass._map.rooms.dirtyLots = true;
195 type = new AreaTypeRoom
196 {
197 owner = this
198 };
199 SetRandomName(num4);
200 if (plate != null)
201 {
202 data.name = plate.areaData.name;
203 if (plate.areaData.type != null)
204 {
206 }
207 data.group = plate.areaData.group;
208 data.atrium = plate.areaData.atrium;
209 data.accessType = plate.areaData.accessType;
210 }
211 }
AreaType type
Definition: AreaData.cs:10
BaseArea.AccessType accessType
Definition: AreaData.cs:42
int group
Definition: AreaData.cs:18
bool atrium
Definition: AreaData.cs:66
string name
Definition: AreaData.cs:7
AreaType type
Definition: BaseArea.cs:32
void SetRandomName(int seed=-1)
Definition: BaseArea.cs:117
Definition: Cell.cs:7
Room room
Definition: Cell.cs:102
byte TopHeight
Definition: Cell.cs:117
bool HasWall
Definition: Cell.cs:833
bool HasFullBlockOrWallOrFence
Definition: Cell.cs:820
bool HasFullBlock
Definition: Cell.cs:817
int Size
Definition: MapBounds.cs:20
Cell[,] cells
Definition: Map.cs:85
SourceMaterial.Row matBlock
Definition: Point.cs:55
SourceBlock.Row sourceBlock
Definition: Point.cs:63
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
Cell cell
Definition: Point.cs:51
Point pointMaxX
Definition: Room.cs:25
int x
Definition: Room.cs:5
int z
Definition: Room.cs:7
bool roof
Definition: Room.cs:17
bool dirty
Definition: Room.cs:15
bool fullblock
Definition: Room.cs:19
int mx
Definition: Room.cs:9
Point pointMinX
Definition: Room.cs:23
int mh
Definition: Room.cs:13
Dictionary< int, int > roofCount
Definition: Room.cs:27
int mz
Definition: Room.cs:11
virtual bool IsWall
Definition: TileType.cs:133
virtual bool IsFence
Definition: TileType.cs:167
AreaData areaData

References EClass._map, AreaData.accessType, TraitRoomPlate.areaData, AreaData.atrium, Point.cell, Map.cells, Clean(), dirty, fullblock, AreaData.group, Cell.HasFullBlock, Cell.HasFullBlockOrWallOrFence, Cell.HasWall, TileType.IsFence, TileType.IsWall, Point.matBlock, mh, mx, mz, AreaData.name, BaseArea.plate, pointMaxX, pointMinX, BaseArea.points, roof, roofCount, Cell.room, BaseArea.SetRandomName(), MapBounds.Size, Point.sourceBlock, Cell.TopHeight, AreaData.type, BaseArea.type, Point.x, x, Point.z, and z.

◆ SetDirty()

void Room.SetDirty ( )
inline

Definition at line 213 of file Room.cs.

214 {
215 dirty = true;
216 EClass._map.rooms.dirtyRooms = true;
217 }

References dirty.

Referenced by AddPoint(), RoomManager.AddRoom(), Map.Burn(), OnLoad(), Map.SetBlock(), and Map.SetBridge().

◆ ToString()

override string Room.ToString ( )
inline

Definition at line 31 of file Room.cs.

32 {
33 return uid.ToString() ?? "";
34 }

References BaseArea.uid.

Referenced by WidgetDebug.UpdateText().

Member Data Documentation

◆ dirty

bool Room.dirty

Definition at line 15 of file Room.cs.

Referenced by Refresh(), and SetDirty().

◆ fullblock

bool Room.fullblock

Definition at line 19 of file Room.cs.

Referenced by Refresh().

◆ lot

◆ mh

int Room.mh

Definition at line 13 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), Refresh(), and Lot.SetBaseRoom().

◆ mx

int Room.mx

Definition at line 9 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), RoomManager.RebuildLots(), Refresh(), and Lot.SetBaseRoom().

◆ mz

int Room.mz

Definition at line 11 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), Refresh(), and Lot.SetBaseRoom().

◆ pointMaxX

Point Room.pointMaxX

Definition at line 25 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), Refresh(), and Lot.SetBaseRoom().

◆ pointMinX

Point Room.pointMinX

Definition at line 23 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), Refresh(), and Lot.SetBaseRoom().

◆ roof

bool Room.roof

Definition at line 17 of file Room.cs.

Referenced by Refresh().

◆ roofCount

Dictionary<int, int> Room.roofCount = new Dictionary<int, int>()

Definition at line 27 of file Room.cs.

Referenced by Refresh().

◆ x

int Room.x

Definition at line 5 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), RoomManager.RebuildLots(), Refresh(), and Lot.SetBaseRoom().

◆ z

int Room.z

Definition at line 7 of file Room.cs.

Referenced by Lot.AddConnectedRooms(), RoomManager.RebuildLots(), Refresh(), and Lot.SetBaseRoom().

Property Documentation

◆ HasRoof


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