示例#1
0
 public void AddDeck(CardList CL)
 {
     mDeck = CL;
     foreach (Entity E in mDeck.Cards)
     {
         E.Owner = this;
     }
 }
示例#2
0
        private static float ScoreHand(CardList hand)
        {
            float totalScore = 0;

            foreach (Entities.Entity E in hand.Cards)
            {
                if (E.IsUnit())
                {
                    Entities.Unit U = (Unit)E;
                    totalScore += ScoreUnit(U);
                }
                else
                {
                    // TODO score non-unit cards
                    totalScore += 25;
                }
            }
            return(totalScore);
        }
示例#3
0
        private static float EvaluateFutureRounds(int playerIndex, CardGameState gameState, int roundsToWin, int opposingRoundsToWin)
        {
            if (roundsToWin == 0)
            {
                return(1.0f);
            }
            else if (opposingRoundsToWin == 0)
            {
                return(0.0f);
            }

            int opposingPlayerIndex = (playerIndex + 1) % 2;

            CardList playerHand         = gameState.Players[playerIndex].mHand;
            CardList opposingPlayerHand = gameState.Players[opposingPlayerIndex].mHand;

            return(TraverseRoundWinTree(playerIndex, playerHand.Cards.Count, ScoreHand(playerHand) / playerHand.Cards.Count, roundsToWin,
                                        opposingPlayerIndex, opposingPlayerHand.Cards.Count, ScoreHand(opposingPlayerHand) / opposingPlayerHand.Cards.Count, opposingRoundsToWin));
        }
示例#4
0
 public CardZone(int PlayerIndex, int Range, ZoneType Type)
 {
     List      = new CardList();
     this.Type = new CardZoneType(Type, (Range)Range, PlayerIndex);
 }