Open Longwelwind opened 3 years ago
Timed actions would be a way to program the execution of an action in the future. This could have multiple usage:
The API would roughly look like:
processAction(action) { if (action.type == "move-troops") { const time = this.computeTimeInMsForTroopToMove(); this.planAction(time, { type: "troop-arrived", troop: action.troopId }); } } processTimedAction(action) { if (action.type == "troop-arrived") { // Process the action } }
Timed actions would be a way to program the execution of an action in the future. This could have multiple usage:
The API would roughly look like: