public Map(MapTilesSetup mapSetup) { _maxRow = mapSetup.Tiles.Max(item => Mathf.Abs(item.Row)) + 1; _maxColumn = mapSetup.Tiles.Max(item => Mathf.Abs(item.Column)) + 1; _tiles = MakeTiles(mapSetup.Tiles); _neighbors = GetNeighborsDictionary(); }
public MapAssetSet GetMapAssetSet() { MapTilesBasis mapBasis = new MapTilesBasis(MapDefinitionFile); MapTilesSetup mapSetup = new MapTilesSetup(mapBasis, MapTileSetup.text); return(new MapAssetSet(mapSetup, MapBase, MapBorders)); }
public MapAssetSet(MapTilesSetup mapSetup, Texture2D baseMap, Texture2D borderMap) { MapSetup = mapSetup; BaseMap = baseMap; BorderMap = borderMap; Map map = new Map(mapSetup); NeighborsTable = LoadNeighborsData(map); }
internal static IEnumerable <PlayerSetup> CreateFromMapDefinition(MapTilesSetup mapSetup) { List <PlayerSetup> ret = new List <PlayerSetup>(); int index = 0; foreach (MapTileSetup item in mapSetup.Tiles.Where(item => item.IsStartPosition)) { index++; string name = "Player " + index; Color playerColor = GetPlayerColor(); PlayerSetup retItem = new PlayerSetup(name, playerColor, item.Row, item.Column); ret.Add(retItem); } return(ret); }