private void InitTiles(IRawMap map) { Tiles = new Tile[Height][]; FlatTiles = new List <Tile>(Width * Height); for (var y = 0; y < Height; y++) { Tiles[y] = new Tile[Width]; for (var x = 0; x < Width; x++) { var rawTile = map.Map[y][x].ToString(); var type = rawTile switch { MapKey.Asteroid => TileType.Asteroid, MapKey.Empty => TileType.Empty, _ => throw new Exception("Unknown tile type") }; Tiles[y][x] = new Tile(type, new Coordinates(x, y)); FlatTiles.Add(Tiles[y][x]); } } } }
partial void UpdateCore(IRawMap raw) { Info = owner.MasterData.MapInfos[raw.Id]; }
public Map(IRawMap rawMap) { Width = rawMap.Map[0].Length; Height = rawMap.Map.Count; InitTiles(rawMap); }
partial void UpdateCore(IRawMap raw, DateTimeOffset timeStamp) { Info = owner.MasterData.MapInfos[raw.Id]; }