Began migrating action engine to async

To suspending actions to await user input
This commit is contained in:
ThaumRystra
2023-11-13 00:24:51 +02:00
parent 800ef3328c
commit 5a2df36e8b
17 changed files with 222 additions and 71 deletions

View File

@@ -5,9 +5,11 @@ import {
import { groupBy, remove } from 'lodash';
export default class ActionContext {
constructor(creatureId, targetIds = [], method) {
constructor(creatureId, targetIds = [], method, activeActionId) {
// Get the creature
this.creature = getCreature(creatureId)
// Store an active action ID for pausing/resuming this action
this.activeActionId = activeActionId
if (!this.creature) {
throw new Meteor.Error('No Creature', `No creature could be found with id: ${creatureId}`)