11 public virtual string Name
15 if (!this.data.name.IsEmpty())
17 return this.data.name;
19 return this.type.source.GetName();
29 return this.data.accessType ==
BaseArea.AccessType.Private;
39 return this.type.source;
44 public Point GetRandomFreePos()
46 for (
int i = 0; i < 100; i++)
58 public Thing GetEmptySeat()
60 foreach (
Point point
in this.points)
62 foreach (
Thing thing
in point.Things)
64 if (thing.IsInstalled && !thing.pos.HasChara && thing.trait is
TraitChair)
74 public virtual Point GetRandomPoint(
bool walkable =
true,
bool allowChara =
true)
78 for (
int i = 0; i < 100; i++)
80 foreach (
Point point
in this.points)
82 if (!point.IsBlocked && (allowChara || !point.HasChara))
89 return this.points.RandomItem<
Point>();
93 public void ChangeType(
string _id)
95 this.type = ClassCache.Create<
AreaType>(
"AreaType" + _id,
"Elin");
97 this.type.owner =
this;
98 if (this.plate !=
null)
100 this.plate.areaData.type = this.type;
105 public void SetRandomName(
int seed = -1)
107 this.data.name = this.GetRandomName(seed);
111 public string GetRandomName(
int seed = -1)
118 string combinedName = WordGen.GetCombinedName((branch !=
null) ? branch.GetRandomName() :
null,
this.ListRoomNames().RandomItem<
string>(),
true);
127 public HashSet<string> ListRoomNames()
129 HashSet<string> hashSet =
new HashSet<string>();
130 foreach (
string item
in Lang.GetList(
"rooms"))
134 foreach (
Point point
in this.points)
136 foreach (
Thing thing
in point.Things)
138 if (thing.IsInstalled && !thing.source.roomName.IsEmpty())
140 foreach (
string item2
in thing.source.GetTextArray(
"roomName"))
151 public int GetSortVal(UIList.SortMode m)
153 return this.source._index;
163 text =
"accessType".lang((
"access_" + this.data.accessType.ToString()).lang(),
null,
null,
null,
null),
166 UIContextMenu uicontextMenu =
EClass.ui.CreateContextMenuInteraction();
167 foreach (
BaseArea.AccessType accessType in Util.EnumToList<
BaseArea.AccessType>())
169 uicontextMenu.AddButton(((this.data.accessType == accessType) ?
"context_checker".lang() :
"") + (
"access_" + accessType.ToString()).lang(), delegate()
171 this.data.accessType = ((this.data.accessType ==
BaseArea.AccessType.Public) ? BaseArea.AccessType.Private :
BaseArea.AccessType.Public);
172 if (this.plate !=
null)
174 this.plate.areaData.accessType = this.data.accessType;
179 CursorSystem.ignoreCount = 5;
180 uicontextMenu.Show();
188 List<string> list =
new List<string>();
192 for (
int i = 0; i < 10; i++)
194 list.Add(this.GetRandomName(-1));
197 }, delegate(
int a,
string b)
199 this.data.name = list[a];
200 if (this.plate !=
null)
202 this.plate.areaData.name = list[a];
204 },
true).SetSize(450f, -1f).EnableReroll();
209 text =
"toggleShowWallItem".lang() +
"(" + (this.data.showWallItem ?
"on" :
"off").lang() +
")",
212 this.data.showWallItem = !this.data.showWallItem;
218 text =
"toggleAtrium".lang() +
"(" + (this.data.atrium ?
"on" :
"off").lang() +
")",
221 this.data.atrium = !this.data.atrium;
222 if (this.plate !=
null)
224 this.plate.areaData.atrium = this.data.atrium;
231 text =
"limitRoomHeight",
234 List<string> list =
new List<string>();
238 for (
int i = 1; i < 10; i++)
240 list.Add(i.ToString() ??
"");
243 }, delegate(
int a,
string b)
245 this.data.maxHeight = a + 1;
246 if (this.plate !=
null)
248 this.plate.areaData.maxHeight = a + 1;
250 EClass._map.rooms.RefreshAll();
256 text =
"changeGroup",
259 List<string> list =
new List<string>();
263 for (
int i = 0; i < 5; i++)
265 list.Add(i.ToString() ??
"");
268 }, delegate(
int a,
string b)
271 if (this.plate !=
null)
273 this.plate.areaData.group = a;
275 EClass._map.rooms.RefreshAll();
283 public void OnInspect()
289 public bool CanInspect
299 public string InspectName
309 public Point InspectPoint
313 return Point.Invalid;
318 public void WriteNote(UINote n, Action<UINote> onWriteNote =
null,
IInspect.NoteMode mode =
IInspect.NoteMode.Default,
Recipe recipe =
null)
321 n.AddHeaderCard(this.Name,
null);
327 public Vector3 InspectPosition
355 public enum AccessType
370 public Action action;