Beispiel #1
0
 public void Update(BotsSensorsData data)
 {
     CurrentPosition = data.RobotsLocations.Where(z => z.Id == RobotId).FirstOrDefault();
     OpponentPosition = data.RobotsLocations.Where(z => z.Id == OpponentRobotId).FirstOrDefault();
     Details = data.Map.Where(x => x.Tag.Contains("Detail")).Select(x => new StarshipObject
         {
             DiscreteCoordinate = GetDiscretePosition((int)x.X, (int)x.Y),
             AbsoluteCoordinate = new Point((int) x.X, (int) x.Y),
             Type = x.Tag
         }).ToArray();
     Walls = data.Map.Where(IsWall).Select(w => new StarshipObject
         {
             DiscreteCoordinate = GetDiscretePosition((int)w.X, (int)w.Y),
             AbsoluteCoordinate = new Point((int)w.X, (int)w.Y),
             Type = w.Tag
         }).ToArray();
 }
Beispiel #2
0
 public void Update(BotsSensorsData sensorData)
 {
     map.Update(sensorData);
     realRobotAngle = map.CurrentPosition.Angle;
 }
Beispiel #3
0
 private void Init(BotsSensorsData data)
 {
     RobotId = data.RobotId;
     OpponentRobotId = RobotId == TwoPlayersId.Left ? TwoPlayersId.Right : TwoPlayersId.Left;
 }
Beispiel #4
0
 public InternalMap(BotsSensorsData data)
 {
     Init(data);
     Update(data);
 }