Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
DesignationList.cs
Go to the documentation of this file.
1public class DesignationList<T> : TaskList<T> where T : TaskDesignation
2{
4
5 public override void OnAdd(T t)
6 {
7 base.OnAdd(t);
8 t.pos.ForeachMultiSize(t.W, t.H, delegate(Point p, bool main)
9 {
10 Designations.mapAll.Add(p.index, t);
12 });
13 }
14
15 protected override bool TryAdd(T t)
16 {
17 if (!CanAdd(t.pos))
18 {
19 return false;
20 }
21 return base.TryAdd(t);
22 }
23
24 public bool CanAdd(Point p)
25 {
26 if (!p.IsValid || Designations.mapAll.ContainsKey(p.index))
27 {
28 return false;
29 }
30 return true;
31 }
32
33 protected override void Remove(T t)
34 {
35 base.Remove(t);
36 t.pos.ForeachMultiSize(t.W, t.H, delegate(Point p, bool main)
37 {
38 Designations.mapAll.Remove(p.index);
41 });
42 }
43}
TaskDesignation designation
Definition: CellDetail.cs:19
CellDetail GetOrCreateDetail()
Definition: Cell.cs:1529
void TryDespawnDetail()
Definition: Cell.cs:1538
override void OnAdd(T t)
bool CanAdd(Point p)
override bool TryAdd(T t)
TaskManager.Designations Designations
override void Remove(T t)
Definition: EClass.cs:5
static Map _map
Definition: EClass.cs:18
TaskManager tasks
Definition: Map.cs:34
Definition: Point.cs:9
int index
Definition: Point.cs:49
bool IsValid
Definition: Point.cs:88
Cell cell
Definition: Point.cs:51
Designations designations
Definition: TaskManager.cs:62