Exemplo n.º 1
0
        public void MoveRobot(int idRobot, RobotMove move)
        {
            var robotToMove = _battleArena.GetRobotById(idRobot);

            if (robotToMove != null)
            {
                robotToMove.PerformBattleMove(move);
            }
        }
Exemplo n.º 2
0
        public void Should_get_robot_by_id()
        {
            var robotsToDeploy = new List <IRobot> {
                new Robot(new Compass())
                {
                    Position = new RobotPosition {
                        Location = new ArenaCoordinates()
                        {
                            X = 1, Y = 2
                        }, Heading = CompassPoint.N
                    }
                }
            };

            battleArena.DeployRobots(robotsToDeploy);
            var robot = battleArena.GetRobotById(0);

            robot.Should().Not.Be.Null();
        }