Exemple #1
0
        public void Visit(GameElement gameElement)
        {
            Host = gameElement;

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

            if (Life > 0)
            {
                gameElement.MarkAsConsumed();
            }
        }
        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);
        }
Exemple #3
0
 public Player(GameElement host = null,
               int initialLife  = Constants.PlayerLife)
     : base(initialLife)
 {
     Host = host;
 }