public void AddActionToHandleListener(DynamicActionEvent dynamicActionEvent) { //TODO add more complex way to take actions ActionAnswer actionAnswer = dynamicActionEvent.ActionAnswers[0]; ActionResponseEvent actionResponseEvent = new ActionResponseEvent(dynamicActionEvent, actionAnswer); _eventBus.Post(actionResponseEvent); }
public void MoveInListener(MoveInEvent moveInEvent) { long index = _grid.GetNodeIndex(moveInEvent.Current); if (!_chests.Contains(index)) { return; } _chests.Remove(index); Action action = new Action(_actionDefinition); action.AddParam("gold", 1500); DynamicActionEvent dynamicActionEvent = new DynamicActionEvent(action, _actionAnswers, moveInEvent.MoveToNextEvent.Owner); _eventBus.Post(dynamicActionEvent); Debug.WriteLine("Chest Taken"); }
public void MoveInListener(MoveInEvent moveInEvent) { long index = _grid.GetNodeIndex(moveInEvent.Current); if (!_habitats.Contains(index)) { return; } Habitat habitat = _nodeToEntityLinker[index].GetComponent <Habitat>(); Action action = new Action(_actionDefinition); action.AddParam("population", habitat.Current); action.AddParam("habitat", habitat); DynamicActionEvent dynamicActionEvent = new DynamicActionEvent(action, _actionAnswers, moveInEvent.MoveToNextEvent.Owner); _eventBus.Post(dynamicActionEvent); Debug.WriteLine("Recruitment Start"); }
public void AddActionToHandleListener(DynamicActionEvent dynamicActionEvent) { _onGoingActions.Add(dynamicActionEvent.Id, dynamicActionEvent); }
public FinishActionBlocker(DynamicActionEvent actionToFinish) { ActionToFinish = actionToFinish; }