Example #1
0
        public void Program(IRobotControl robot)
        {
            robot.GoDown();
            robot.GoDown();

            for (int i = 0; i < 5; i++)
            {
                robot.GoRight();
            }

            robot.GoUp();
            robot.GoUp();

            robot.GoRight();
        }
Example #2
0
    public void AddRobot(string id, IRobotControl control)
    {
        Coordinates randomPosition;

        do
        {
            randomPosition = arena.RandomCoordinates(random);
        } while (robots.Any(x => x.Position == randomPosition));

        var r = new Robot
        {
            Id        = id,
            Position  = randomPosition,
            Bearing   = Bearing.North,
            Velocity  = 0,
            Control   = control,
            HitPoints = 100,
        };

        robots.Add(r);
    }
Example #3
0
File: XRobot.cs Project: eijix/test
 /// <summary>
 /// 注册入战场
 /// </summary>
 /// <param name="Robot"></param>
 /// <param name="Env"></param>
 public void RegistedToWorld(IRobotControl Robot, IBattleEnv Env,IBattleMap Map)
 {
     this.Robot = Robot;
     this.Env = Env;
     this.Map = Map;
 }
Example #4
0
 public void Program(IRobotControl robot)
 {
     robot.GoRight();
     robot.GoRight();
     robot.GoRight();
 }