public GameMap(MapManager mapManager, JsonMap jsonMap) { myMapManager = mapManager; Name = jsonMap.Name; MapWidth = jsonMap.MapWidth; MapHeight = jsonMap.MapHeight; TileMap = new Tile[MapWidth][]; CollisionMap = new CollisionType[MapWidth][]; for (int x = 0; x < MapWidth; x++) { TileMap[x] = new Tile[MapHeight]; CollisionMap[x] = new CollisionType[MapHeight]; for (int y = 0; y < MapHeight; y++) { string key = jsonMap.TileMap[x][y]; var tile = myMapManager.myGameManager.TileManager.GetTileByKey(key); TileMap[x][y] = tile; CollisionMap[x][y] = tile.Collision; } } }
public GameManager() { TileManager = new TileManager(this); MapManager = new MapManager(this, 400, 400); UnitManager = new UnitManager(this); }
public DrawGameMap(MapManager mapManager, JsonMap jsonMap) : base(mapManager, jsonMap) { }