* @static shouldRollback - Similarly to the shouldProceed () function, this one takes * action when the player tries to go back in the game.Monogatari will first * check with all actions if it's ok to go back. Every action should implement * its own logic for it according to its requirements.
()
| 182 | * @return {Promise} - Resolved if going back is alright or rejected if its not |
| 183 | */ |
| 184 | static async shouldRollback (): Promise<void[]> { |
| 185 | const promises: Promise<void>[] = []; |
| 186 | |
| 187 | this.instances((instance: any) => { |
| 188 | promises.push(instance.shouldRollback()); |
| 189 | }); |
| 190 | |
| 191 | return Promise.all(promises); |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * @static willRollback - Once the shouldRollback check is passed, each action |