Exemplo n.º 1
0
        public void ActionCommand(int commandRotate, IGenericGameArea gameArea)
        {
            //TODO: return cell, not only type
            Coordinate targetPosition = AnalyzePosition(commandRotate);
            IBaseCell  cellOnWay      = gameArea.GetCellOnPosition(targetPosition);

            if (cellOnWay == null)
            {
                return;
            }

            PointType cellType = cellOnWay.GetPointType();

            if (cellType == PointType.Food)
            {
                gameArea.TryEat(this, targetPosition);

                return;
            }

            if (cellType == PointType.Cell)
            {
                //Attack?
            }

            if (cellType == PointType.Trap)
            {
                Health = 0;
            }
        }
Exemplo n.º 2
0
        public void MakeTurn(IGenericGameArea gameArea)
        {
            if (!IsAlive())
            {
                return;
            }

            Brain.MakeTurn(this, gameArea);
            IncreaseAge();
        }
Exemplo n.º 3
0
        public void MoveCommand(int commandRotate, IGenericGameArea gameArea)
        {
            ActionCommand(commandRotate, gameArea);

            Coordinate targetPosition = AnalyzePosition(commandRotate);
            IBaseCell  targetCell     = gameArea.GetCellOnPosition(targetPosition);

            if (targetCell == null)
            {
                Position = targetPosition;
            }
        }
Exemplo n.º 4
0
 public void MakeTurn(IGenericGameArea gameArea)
 {
     // Do nothing
 }
Exemplo n.º 5
0
 public void MakeTurn(IGenericGameArea gameArea)
 {
 }