Commit ed50a48
authored
Update switchblock.ts - adding extra execution pathway ...
New Execution Pathway:
- **Name:** `switchcase.executeFromValue(name: string, value: any)`
- Adds new block for executing a registered switch (with already registered cases) but that allows you to postpone the switch.value until the time of execution.
- This provides a few _NEW_ features:
1. You can now add new cases later in the game, such as a new power up you claimed.
2. You can now remove cases later in the game, such as when a powerup is replaced by a new one or when a powerup fails/exhausts due to usage or time limit.
3. Because execution occurs at any time, your switch-case can be registered like a lookup table whenever you desire, but only execute during the absolute moment when it needs to be executed, allowing you to not only execute from an existing value, the value can now be the most recent value upon execution (like a standard switch statement) which provides freedom to update the value as necessary without fear of using an out-of-date variable...
- The switch-case now no longer 'penalizes' you for not knowing the variable (or its state) at the beginning of the creation of said switch-case.1 parent 34cd195 commit ed50a48
1 file changed
Lines changed: 34 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
83 | 103 | | |
84 | 104 | | |
85 | 105 | | |
86 | | - | |
| 106 | + | |
87 | 107 | | |
| 108 | + | |
88 | 109 | | |
89 | 110 | | |
90 | 111 | | |
| |||
99 | 120 | | |
100 | 121 | | |
101 | 122 | | |
| 123 | + | |
102 | 124 | | |
103 | 125 | | |
104 | 126 | | |
105 | | - | |
| 127 | + | |
| 128 | + | |
106 | 129 | | |
| 130 | + | |
107 | 131 | | |
108 | 132 | | |
| 133 | + | |
109 | 134 | | |
110 | 135 | | |
111 | 136 | | |
112 | 137 | | |
113 | 138 | | |
114 | 139 | | |
115 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
116 | 143 | | |
117 | 144 | | |
118 | 145 | | |
| |||
0 commit comments