Esempio n. 1
0
        public bool CanAttackEnemy(Player player, Card card, Player enemy, PlayerBoard enemyBoard)
        {
            if (player.Enemy.Board.Cards.Any(el => el.HasTaunt))
            {
                return(false);
            }

            return(card.Attack > 0 && card.NoActionsAvailable > 0);
        }
Esempio n. 2
0
        public static PlayerBoard FromDeck(Deck deck)
        {
            var pb = new PlayerBoard();

            if (deck != null && deck.Cards != null && deck.Cards.Any())
            {
                pb.Cards.AddRange(deck.Clone().Cards);
            }

            return(pb);
        }
Esempio n. 3
0
        public Board(Player player1, Player player2, PlayerBoard board1 = null, PlayerBoard board2 = null)
        {
            Players = new List <Player>(2);
            Players.Add(player1);
            Players.Add(player2);

            PlayerBoards = new List <PlayerBoard>(2);

            player1.Board = board1 ?? new PlayerBoard();
            PlayerBoards.Add(player1.Board);

            player2.Board = board2 ?? new PlayerBoard();
            PlayerBoards.Add(player2.Board);
        }
Esempio n. 4
0
        public Player Clone()
        {
            var p = new Player(Deck.Clone());

            p.Id     = Id;
            p.Health = Health;
            p.Hand   = Hand.FromDeck(Hand);
            p.Mana   = Mana;
            p.Board  = PlayerBoard.FromDeck(Board);
            p.Depth  = Depth;

            p.healthPenalty = healthPenalty;

            return(p);
        }
Esempio n. 5
0
 public bool CanPlayOnBoard(Player player, PlayerBoard board)
 {
     return(player.Mana >= GetCost(player) && (board.Cards == null || board.Cards.Count < board.MaxSize));
 }