Exemplo n.º 1
0
        public void Visit(GameElement gameElement)
        {
            Host = gameElement;

            if (gameElement.Life > 0)
            {
                Visit((dynamic)gameElement);
            }

            if (Life > 0)
            {
                gameElement.MarkAsConsumed();
            }
        }
Exemplo n.º 2
0
        Tuple <int, int> GetElementLocation(GameElement gameElement)
        {
            for (int i = 0; i < _mapSize; i++)
            {
                for (int j = 0; j < _mapSize; j++)
                {
                    if (_gameElements[i, j] == gameElement)
                    {
                        return(new Tuple <int, int>(i, j));
                    }
                }
            }

            return(null);
        }
Exemplo n.º 3
0
 public Player(GameElement host = null,
               int initialLife  = Constants.PlayerLife)
     : base(initialLife)
 {
     Host = host;
 }