Exemplo n.º 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();
 }
Exemplo n.º 2
0
 public void Update(BotsSensorsData sensorData)
 {
     map.Update(sensorData);
     realRobotAngle = map.CurrentPosition.Angle;
 }
Exemplo n.º 3
0
 private void Init(BotsSensorsData data)
 {
     RobotId = data.RobotId;
     OpponentRobotId = RobotId == TwoPlayersId.Left ? TwoPlayersId.Right : TwoPlayersId.Left;
 }
Exemplo n.º 4
0
 public InternalMap(BotsSensorsData data)
 {
     Init(data);
     Update(data);
 }