Ejemplo n.º 1
0
        // --------------------------------------------------------------------------------------------
        public Player(PlayerData playerData, Game game, int playerIndex, uint deckSeed)
        {
            this.playerIndex = playerIndex;
            this.name        = playerData.name;

            _game       = game;
            _playerData = playerData;

            Source = playerData.initialSource;

            // create the player's deck
            _deck = new Deck(game, playerData.deckData, this, deckSeed);

            // create the player's discard pile
            _discardPile = new DiscardPile(_game, this);

            // create the player's hand
            _hand = new Hand(_game, this, _deck, _discardPile);

            // create the list of units and the player's hero, and add the hero to the list of units
            _units = new List <Unit>();

            // create the hero and place it on the board
            _hero = PlaceUnit(playerData.heroData, _game.board.GetHeroStartTile(playerIndex));

            _game.GameBegan += OnGameBegan;
        }
Ejemplo n.º 2
0
        // --------------------------------------------------------------------------------------------
        public Hand(Game game, Player owner, Deck deck, DiscardPile discardPile)
        {
            _game        = game;
            _owner       = owner;
            _deck        = deck;
            _discardPile = discardPile;

            _cards = new List <Card>();
        }