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