public List <BattleAction> ReceiveAction(BattleAction action) { Result.NextTurn(); var unit = CurrentActingUnit; if (unit != action.Unit) { action.Result = new ActionResult(); action.Result.Succeeded = false; return(null); } if (action is AttackAction) { var attack = (AttackAction)action; action.Result = attack.Unit.Attack(attack.Defender); action.Result.Succeeded = true; } UpdateRT(unit); Result.AddAction(action); return(Result.CurrentTurn.Actions); }
public void AddAction(BattleAction action) { CurrentTurn.Actions.Add(action); }