public void ExecuteNextAction() { if (currentlyExecutingAction || actionQueue.Count == 0) { return; } currentlyExecutingAction = true; // Debug.Log("Begin executing action"); ActionQueueElement elementToExecute = actionQueue.Dequeue(); elementToExecute.actionGroup.ExecuteActionGroup(elementToExecute.character, elementToExecute.resouceCost); currentlyExecutingAction = false; // Debug.Log("End executing action"); }
public void AddActionToQueue(Character character, ActionGroup actionGroup, int resouceCost) { ActionQueueElement elementToAdd = new ActionQueueElement(character, actionGroup, resouceCost); actionQueue.Enqueue(elementToAdd); }