Elin Decompiled Documentation EA 23.348.1 Nightly
Loading...
Searching...
No Matches
AM_FlagCell.cs
Go to the documentation of this file.
2{
3 public enum Mode
4 {
12 }
13
14 public Mode mode;
15
16 public override bool IsBuildMode => true;
17
18 public override bool UseSubMenu => true;
19
20 public override bool SubMenuAsGroup => true;
21
22 public override int SubMenuModeIndex => (int)mode;
23
25 {
26 get
27 {
28 if (mode != Mode.flagWallPillar)
29 {
30 return BaseTileSelector.SelectType.Multiple;
31 }
32 return BaseTileSelector.SelectType.Single;
33 }
34 }
35
36 public override HitResult HitTest(Point point, Point start)
37 {
38 switch (mode)
39 {
40 case Mode.flagWallPillar:
41 if (!point.cell.HasWall)
42 {
43 return HitResult.Default;
44 }
45 break;
46 case Mode.flagShadow:
47 if (point.Things.Count == 0)
48 {
49 return HitResult.Default;
50 }
51 break;
52 case Mode.flagFloat:
53 if (start != null && start.cell.isForceFloat != point.cell.isForceFloat)
54 {
55 return HitResult.Default;
56 }
57 break;
58 case Mode.flagSnow:
59 if (start != null && start.cell.isClearSnow != point.cell.isClearSnow)
60 {
61 return HitResult.Default;
62 }
63 break;
64 case Mode.flagClear:
65 if (start != null && start.cell.isClearArea != point.cell.isClearArea)
66 {
67 return HitResult.Default;
68 }
69 break;
70 case Mode.flagOcclusion:
71 if (start != null && start.cell.toggleOcclusion != point.cell.toggleOcclusion)
72 {
73 return HitResult.Default;
74 }
75 break;
76 }
77 return HitResult.Valid;
78 }
79
80 public override void OnProcessTiles(Point point, int dir)
81 {
82 switch (mode)
83 {
84 case Mode.flagWallPillar:
85 point.cell.isToggleWallPillar = !point.cell.isToggleWallPillar;
86 break;
87 case Mode.flagShadow:
88 point.Things.ForeachReverse(delegate(Thing t)
89 {
90 t.noShadow = !t.noShadow;
91 });
92 break;
93 case Mode.flagOcclusion:
94 point.cell.toggleOcclusion = !point.cell.toggleOcclusion;
95 break;
96 case Mode.flagFloat:
97 point.cell.isForceFloat = !point.cell.isForceFloat;
98 break;
99 case Mode.flagSnow:
100 point.cell.isClearSnow = !point.cell.isClearSnow;
101 break;
102 case Mode.flagClear:
103 point.cell.isClearArea = !point.cell.isClearArea;
104 if (point.cell.isClearArea)
105 {
106 point.Things.ForeachReverse(delegate(Thing t)
107 {
108 t.Destroy();
109 });
110 }
111 break;
112 }
113 point.RefreshNeighborTiles();
114 }
115
116 public override void OnClickSubMenu(int a)
117 {
118 mode = a.ToEnum<Mode>();
119 base.tileSelector.start = null;
120 }
121
122 public override string OnSetSubMenuButton(int a, UIButton b)
123 {
124 if (a < 6)
125 {
126 Mode mode = a.ToEnum<Mode>();
127 if (mode == Mode.flagClear || mode == Mode.flagWall)
128 {
129 return null;
130 }
131 return mode.ToString();
132 }
133 return null;
134 }
135}
HitResult
Definition: HitResult.cs:2
override HitResult HitTest(Point point, Point start)
Definition: AM_FlagCell.cs:36
override BaseTileSelector.SelectType selectType
Definition: AM_FlagCell.cs:25
override bool IsBuildMode
Definition: AM_FlagCell.cs:16
override bool UseSubMenu
Definition: AM_FlagCell.cs:18
override void OnProcessTiles(Point point, int dir)
Definition: AM_FlagCell.cs:80
override bool SubMenuAsGroup
Definition: AM_FlagCell.cs:20
override string OnSetSubMenuButton(int a, UIButton b)
Definition: AM_FlagCell.cs:122
override int SubMenuModeIndex
Definition: AM_FlagCell.cs:22
override void OnClickSubMenu(int a)
Definition: AM_FlagCell.cs:116
void Destroy()
Definition: Card.cs:5314
bool noShadow
Definition: Card.cs:821
bool toggleOcclusion
Definition: Cell.cs:666
bool isClearSnow
Definition: Cell.cs:462
bool HasWall
Definition: Cell.cs:869
bool isClearArea
Definition: Cell.cs:618
bool isToggleWallPillar
Definition: Cell.cs:570
bool isForceFloat
Definition: Cell.cs:318
Definition: Point.cs:9
List< Thing > Things
Definition: Point.cs:338
void RefreshNeighborTiles()
Definition: Point.cs:1282
Cell cell
Definition: Point.cs:51
Definition: Thing.cs:8