Beispiel #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;
            }
        }
Beispiel #2
0
        public void MakeTurn(IGenericGameArea gameArea)
        {
            if (!IsAlive())
            {
                return;
            }

            Brain.MakeTurn(this, gameArea);
            IncreaseAge();
        }
Beispiel #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;
            }
        }
Beispiel #4
0
 public void MakeTurn(IGenericGameArea gameArea)
 {
     // Do nothing
 }
Beispiel #5
0
 public void MakeTurn(IGenericGameArea gameArea)
 {
 }