private ReadOnlyCollection <CardBattleState> GetHistory(CardBattleState initialState) { List <CardBattleState> ret = new List <CardBattleState>() { initialState }; CardBattleState currentState = initialState; while (currentState.Status == BattleStatus.Undecided && ret.Count < TurnLimit) { currentState = currentState.GetNextState(); ret.Add(currentState); } return(ret.AsReadOnly()); }
public CardBattle(CardBattleState initialState) { History = GetHistory(initialState); Outcome = History.Last().Status; }