예제 #1
0
 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();
 }
예제 #2
0
    public MapAssetSet GetMapAssetSet()
    {
        MapTilesBasis mapBasis = new MapTilesBasis(MapDefinitionFile);
        MapTilesSetup mapSetup = new MapTilesSetup(mapBasis, MapTileSetup.text);

        return(new MapAssetSet(mapSetup, MapBase, MapBorders));
    }
예제 #3
0
    public MapAssetSet(MapTilesSetup mapSetup, Texture2D baseMap, Texture2D borderMap)
    {
        MapSetup  = mapSetup;
        BaseMap   = baseMap;
        BorderMap = borderMap;
        Map map = new Map(mapSetup);

        NeighborsTable = LoadNeighborsData(map);
    }
예제 #4
0
    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);
    }