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

Public Member Functions

void OnLoad ()
 
void AssignCharas ()
 
void RefreshAll ()
 
void Refresh ()
 
void AssignUID (BaseArea a)
 
Area AddArea (Area a, Point p)
 
Area TryAddArea (Point p, Area existingArea)
 
void RemoveArea (Area a)
 
Room AddRoom (Room r)
 
void RemoveRoom (Room r)
 
HitResult GetHitResult (Point point, Point start)
 
void RebuildLots ()
 
BaseArea FindBaseArea (string id)
 

Public Attributes

List< ArealistArea = new List<Area>()
 
List< RoomlistRoom = new List<Room>()
 
int uidRoom = 1
 
Dictionary< int, BaseAreamapIDs = new Dictionary<int, BaseArea>()
 
List< LotlistLot = new List<Lot>()
 
bool dirtyLots
 
bool dirtyRooms
 

Private Attributes

List< BaseAreatempList = new List<BaseArea>()
 

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)
 
- Static Public Attributes inherited from EClass
static Core core
 
- 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 5 of file RoomManager.cs.

Member Function Documentation

◆ AddArea()

Area RoomManager.AddArea ( Area  a,
Point  p 
)
inline

Definition at line 76 of file RoomManager.cs.

77 {
78 if (!listArea.Contains(a))
79 {
80 listArea.Add(a);
81 mapIDs.Add(a.uid, a);
82 }
83 a.AddPoint(p.Copy());
84 return a;
85 }
void AddPoint(Point point, bool onLoad=false)
Definition: Area.cs:27
int uid
Definition: BaseArea.cs:23
Point Copy()
Definition: Point.cs:467
Dictionary< int, BaseArea > mapIDs
Definition: RoomManager.cs:18
List< Area > listArea
Definition: RoomManager.cs:10

References Area.AddPoint(), Point.Copy(), listArea, mapIDs, and BaseArea.uid.

Referenced by AM_CreateArea.OnProcessTiles().

◆ AddRoom()

Room RoomManager.AddRoom ( Room  r)
inline

Definition at line 110 of file RoomManager.cs.

111 {
112 listRoom.Add(r);
113 AssignUID(r);
114 r.SetDirty();
115 mapIDs.Add(r.uid, r);
116 return r;
117 }
void AssignUID(BaseArea a)
Definition: RoomManager.cs:70
List< Room > listRoom
Definition: RoomManager.cs:13
void SetDirty()
Definition: Room.cs:213

References AssignUID(), listRoom, mapIDs, Room.SetDirty(), and BaseArea.uid.

Referenced by Map.TryAddRoom().

◆ AssignCharas()

void RoomManager.AssignCharas ( )
inline

Definition at line 39 of file RoomManager.cs.

40 {
41 }

Referenced by Chara.MoveZone(), and Zone.OnVisit().

◆ AssignUID()

void RoomManager.AssignUID ( BaseArea  a)
inline

Definition at line 70 of file RoomManager.cs.

71 {
72 a.uid = uidRoom;
73 uidRoom++;
74 }

References uidRoom.

Referenced by AddRoom(), and Area.Create().

◆ FindBaseArea()

BaseArea RoomManager.FindBaseArea ( string  id)
inline

Definition at line 164 of file RoomManager.cs.

165 {
166 tempList.Clear();
167 foreach (BaseArea item in ((IEnumerable<BaseArea>)listRoom).Concat((IEnumerable<BaseArea>)listArea))
168 {
169 if (item.type.id == id)
170 {
171 tempList.Add(item);
172 }
173 }
174 if (tempList.Count == 0)
175 {
176 return null;
177 }
178 return tempList.RandomItem();
179 }
List< BaseArea > tempList
Definition: RoomManager.cs:7

References item, listArea, listRoom, and tempList.

◆ GetHitResult()

HitResult RoomManager.GetHitResult ( Point  point,
Point  start 
)
inline

Definition at line 126 of file RoomManager.cs.

127 {
128 if (point.area != null)
129 {
130 return HitResult.Invalid;
131 }
132 if (!point.HasBlock)
133 {
134 return HitResult.Valid;
135 }
136 return HitResult.Default;
137 }
HitResult
Definition: HitResult.cs:2
Area area
Definition: Point.cs:73
bool HasBlock
Definition: Point.cs:141

References Point.area, and Point.HasBlock.

Referenced by AM_CreateArea.HitTest(), and AM_ExpandArea.HitTest().

◆ OnLoad()

void RoomManager.OnLoad ( )
inline

Definition at line 26 of file RoomManager.cs.

27 {
28 foreach (Area item in listArea)
29 {
30 item.OnLoad();
31 }
32 foreach (Room item2 in listRoom)
33 {
34 item2.OnLoad();
35 }
36 Refresh();
37 }
Definition: Area.cs:4
void Refresh()
Definition: RoomManager.cs:52
Definition: Room.cs:4
void OnLoad()
Definition: Room.cs:36

References item, listArea, listRoom, Room.OnLoad(), and Refresh().

Referenced by Map.OnLoad().

◆ RebuildLots()

void RoomManager.RebuildLots ( )
inline

Definition at line 139 of file RoomManager.cs.

140 {
141 listLot.Clear();
142 foreach (Room item in listRoom)
143 {
144 item.lot = null;
145 }
146 foreach (Room item2 in listRoom)
147 {
148 if (item2.lot == null)
149 {
150 Lot lot = new Lot
151 {
152 x = item2.x,
153 z = item2.z,
154 mx = item2.mx,
155 mz = item2.mz
156 };
157 lot.SetBaseRoom(item2);
158 listLot.Add(lot);
159 }
160 }
161 dirtyLots = false;
162 }
Definition: Lot.cs:5
void SetBaseRoom(Room r)
Definition: Lot.cs:82
List< Lot > listLot
Definition: RoomManager.cs:20
bool dirtyLots
Definition: RoomManager.cs:22
int x
Definition: Room.cs:5
int z
Definition: Room.cs:7
int mx
Definition: Room.cs:9
Lot lot
Definition: Room.cs:21

References dirtyLots, item, listLot, listRoom, Room.lot, Room.mx, Lot.SetBaseRoom(), Room.x, and Room.z.

Referenced by Refresh().

◆ Refresh()

void RoomManager.Refresh ( )
inline

Definition at line 52 of file RoomManager.cs.

53 {
54 if (dirtyRooms)
55 {
56 foreach (Room item in listRoom)
57 {
58 if (item.dirty)
59 {
60 item.Refresh();
61 }
62 }
63 }
64 if (dirtyLots)
65 {
67 }
68 }
void RebuildLots()
Definition: RoomManager.cs:139
bool dirtyRooms
Definition: RoomManager.cs:24

References dirtyLots, dirtyRooms, item, listRoom, and RebuildLots().

Referenced by BaseTileMap.Draw(), TileMapElona.Draw(), OnLoad(), and RefreshAll().

◆ RefreshAll()

void RoomManager.RefreshAll ( )
inline

Definition at line 43 of file RoomManager.cs.

44 {
45 foreach (Room item in listRoom)
46 {
47 item.SetDirty();
48 }
49 Refresh();
50 }

References item, listRoom, and Refresh().

Referenced by BaseArea.ListInteractions(), and Map.ReloadRoom().

◆ RemoveArea()

void RoomManager.RemoveArea ( Area  a)
inline

Definition at line 103 of file RoomManager.cs.

104 {
105 listArea.Remove(a);
106 mapIDs.Remove(a.uid);
107 a.OnRemove();
108 }
void OnRemove()
Definition: Area.cs:84

References listArea, mapIDs, Area.OnRemove(), and BaseArea.uid.

Referenced by AM_EditArea.OnProcessTiles(), and InspectGroupArea.OnSetActions().

◆ RemoveRoom()

void RoomManager.RemoveRoom ( Room  r)
inline

Definition at line 119 of file RoomManager.cs.

120 {
121 listRoom.Remove(r);
122 mapIDs.Remove(r.uid);
123 r.OnRemove();
124 }
void OnRemove()
Definition: Room.cs:54

References listRoom, mapIDs, Room.OnRemove(), and BaseArea.uid.

Referenced by Map.TryRemoveRoom().

◆ TryAddArea()

Area RoomManager.TryAddArea ( Point  p,
Area  existingArea 
)
inline

Definition at line 87 of file RoomManager.cs.

88 {
89 if (p.area != null)
90 {
91 return existingArea;
92 }
93 if (existingArea == null)
94 {
95 existingArea = Area.Create("public");
96 listArea.Add(existingArea);
97 mapIDs.Add(existingArea.uid, existingArea);
98 }
99 existingArea.AddPoint(p.Copy());
100 return existingArea;
101 }
static Area Create(string id)
Definition: Area.cs:104

References Area.AddPoint(), Point.area, Point.Copy(), Area.Create(), listArea, mapIDs, and BaseArea.uid.

Member Data Documentation

◆ dirtyLots

bool RoomManager.dirtyLots

Definition at line 22 of file RoomManager.cs.

Referenced by RebuildLots(), and Refresh().

◆ dirtyRooms

bool RoomManager.dirtyRooms

Definition at line 24 of file RoomManager.cs.

Referenced by Refresh().

◆ listArea

◆ listLot

List<Lot> RoomManager.listLot = new List<Lot>()

Definition at line 20 of file RoomManager.cs.

Referenced by BaseTileMap.Draw(), and RebuildLots().

◆ listRoom

◆ mapIDs

Dictionary<int, BaseArea> RoomManager.mapIDs = new Dictionary<int, BaseArea>()

◆ tempList

List<BaseArea> RoomManager.tempList = new List<BaseArea>()
private

Definition at line 7 of file RoomManager.cs.

Referenced by FindBaseArea().

◆ uidRoom

int RoomManager.uidRoom = 1

Definition at line 16 of file RoomManager.cs.

Referenced by AssignUID().


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