Exemplo n.º 1
0
 private Map createBaseMap()
 {
     _baseMap = new Map(this);
     _baseMap.SetWorldProperties(_worldProperties);
     _baseMap.GetMapBody().initializeMap(_mapSizeX, _mapSizeY);
     return _baseMap;
 }
Exemplo n.º 2
0
 internal void Reset()
 {
     LOG.Info("Reseting base map");
     StopAllChildMaps();
     _baseMap.StopWork();
     _baseMap = createBaseMap();
     _baseMap.StartWork();
 }
Exemplo n.º 3
0
Arquivo: Map.cs Projeto: marmur/jm_mrs
 public IMapManagment CreateChildMap()
 {
     Map child = new Map(_mapManager);
     child.GetMapBody().setParent(this);
     _mapManager.RegisterChildMap(child);
     child.SetWorldProperties(_worldProperties);
     child.StartWork();
     return child;
 }
Exemplo n.º 4
0
 public void Initialize(Geom[] geoms, Robot[] robots)
 {
     StopAllChildMaps();
     Pair world = FindLargestGeom(geoms);
     Vector worldSize = world.Size;
     Vector floorPosition = world.Position;
     Vector robotSize = FindSmallestRobot(robots);
     double longEdge = robotSize.X > robotSize.Y ? robotSize.X : robotSize.Y;
     double cellSize = longEdge / 3.0;
     _mapSizeX = (int)Math.Ceiling(worldSize.X / cellSize);
     _mapSizeY = (int)Math.Ceiling(worldSize.Y / cellSize);
     double positionX = floorPosition.X - worldSize.X / 2.0;
     double positionY = floorPosition.Y - worldSize.Y /2.0;
     if (_baseMap != null)
     {
         _baseMap.StartWork();
     }
     LOG.Info("Map size : [ " + _mapSizeX + " , " + _mapSizeY + " ] position(0,0): [" + positionX + " , " + positionY + "]");
     _worldProperties = new WorldProperties(_mapSizeX, _mapSizeY, worldSize.X, worldSize.Y, positionX, positionY);
     _baseMap = createBaseMap();
     _baseMap.StartWork();
 }
Exemplo n.º 5
0
 internal void RegisterChildMap(Map child)
 {
     _childMaps.Add(child);
 }