public void Update(PositionSensorsData data) { CurrentPosition = data.Position.PositionsData[RobotId]; OpponentPosition = data.Position.PositionsData[OpponentRobotId]; Details = data.MapSensor.MapItems.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.MapSensor.MapItems.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(); }
public Point GetDiscretePosition(PositionData positionData) { return GetDiscretePosition((int)positionData.X, (int)positionData.Y); }
protected Point GetCoordinatesByPosition(PositionData position) { return GetCoordinatesByPosition((int)position.X, (int)position.Y); }
public ManyPositionData(PositionData[] data) { PositionsData = data; }