()
| 139 | } |
| 140 | |
| 141 | override async revert(): Promise<void> { |
| 142 | const history = this.engine.history('character') as { statement: string; previous: string | null }[]; |
| 143 | for (let i = history.length - 1; i >= 0; i--) { |
| 144 | const { statement } = history[i]; |
| 145 | const [, , asset] = statement.split(' '); |
| 146 | |
| 147 | if (asset === this.asset) { |
| 148 | const action = this.engine.prepareAction(statement, { cycle: 'Application' }) as import('../lib/types').ActionInstance | null; |
| 149 | if (action !== null) { |
| 150 | await action.apply(); |
| 151 | await action.didApply({ updateHistory: false, updateState: true }); |
| 152 | } |
| 153 | return; |
| 154 | } |
| 155 | } |
| 156 | throw new Error('Failed to revert HideCharacter'); |
| 157 | } |
| 158 | |
| 159 | override async didRevert(): Promise<ActionRevertResult> { |
| 160 | return { advance: true, step: true }; |
nothing calls this directly
no test coverage detected