コード例 #1
0
        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());
        }
コード例 #2
0
 public CardBattle(CardBattleState initialState)
 {
     History = GetHistory(initialState);
     Outcome = History.Last().Status;
 }