private static void Main(string[] args) { var server = new CvarcClient(args, Settings).GetServer <PositionSensorsData>(); var sensorData = server.Run().SensorsData; var map = sensorData.BuildMap(); var robotLocator = new RobotLocator(map); var path = PathSearcher.FindPath(map, map.GetDiscretePosition(map.CurrentPosition), new Point(2, 1));//(2, 1) - just random point foreach (var direction in path) { foreach (var command in robotLocator.GetCommandsByDirection(direction)) { sensorData = server.SendCommand(command); robotLocator.Update(sensorData); } } server.SendCommand(new Command { Action = CommandAction.WaitForExit }); }
private void Update() { RobotLocator.Update(Competitions.GetSensorsData <PositionSensorsData>(ControlledRobot)); OpponentCoordinates = GetCoordinatesByPosition(Map.OpponentPosition); OurCoordinates = GetCoordinatesByPosition(Map.CurrentPosition); }