Ejemplo n.º 1
0
        public MapLoader(string mapPath)
        {
            string content = File.ReadAllText(mapPath);
            var    map     = JsonConvert.DeserializeObject <Map>(content);

            TileRows = ExtractTileRows(map);
            TileSet  = ExtractTileSet(map);

            Meta = new MapMetaInfo(
                new TeamMetaInfo(
                    ExtractMetaTileIds(map, "l_spawn"),
                    ExtractMetaTileIds(map, "l_base"),
                    ExtractMetaTileIds(map, "l_base_tower"),
                    ExtractMetaTileIds(map, "l_bot_tower"),
                    ExtractMetaTileIds(map, "l_top_tower")),
                new TeamMetaInfo(
                    ExtractMetaTileIds(map, "r_spawn"),
                    ExtractMetaTileIds(map, "r_base"),
                    ExtractMetaTileIds(map, "r_base_tower"),
                    ExtractMetaTileIds(map, "r_bot_tower"),
                    ExtractMetaTileIds(map, "r_top_tower")));
        }
Ejemplo n.º 2
0
        public MapLoader(string mapPath)
        {
			string content = File.ReadAllText(mapPath);
			var map = JsonConvert.DeserializeObject<Map>(content);

			TileRows = ExtractTileRows(map);
			TileSet = ExtractTileSet(map);

			Meta = new MapMetaInfo(
				new TeamMetaInfo(
					ExtractMetaTileIds(map, "l_spawn"),
					ExtractMetaTileIds(map, "l_base"),
					ExtractMetaTileIds(map, "l_base_tower"),
					ExtractMetaTileIds(map, "l_bot_tower"),
					ExtractMetaTileIds(map, "l_top_tower")),
				new TeamMetaInfo(
					ExtractMetaTileIds(map, "r_spawn"),
					ExtractMetaTileIds(map, "r_base"),
					ExtractMetaTileIds(map, "r_base_tower"),
					ExtractMetaTileIds(map, "r_bot_tower"),
					ExtractMetaTileIds(map, "r_top_tower")));
        }