コード例 #1
0
        public void Load(string xmlPath)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(megafileManager.Open(xmlPath));

            foreach (XmlNode teamColorNode in xmlDoc.SelectNodes("/*/TeamColorTypeClass"))
            {
                var teamColor = new TeamColor(this, megafileManager);
                teamColor.Load(teamColorNode.OuterXml);

                teamColors[teamColorNode.Attributes["Name"].Value] = teamColor;
            }

            foreach (var teamColor in TopologicalSortTeamColors())
            {
                teamColor.Flatten();
            }
        }
コード例 #2
0
        public bool GetTileData(string name, int shape, TeamColor teamColor, out int fps, out Tile[] tiles)
        {
            fps   = 0;
            tiles = null;

            if (!this.tiles.TryGetValue(name, out Dictionary <int, TileData> shapes))
            {
                return(false);
            }

            if (shape < 0)
            {
                shape = Math.Max(0, shapes.Max(kv => kv.Key) + shape + 1);
            }
            if (!shapes.TryGetValue(shape, out TileData tileData))
            {
                return(false);
            }

            var key = teamColor?.Name ?? string.Empty;

            if (!tileData.TeamColorTiles.TryGetValue(key, out Tile[] tileDataTiles))
コード例 #3
0
 public bool GetTeamColorTileData(IEnumerable <string> searchTilesets, string name, int shape, TeamColor teamColor, out int fps, out Tile tile)
 {
     tile = null;
     if (!GetTeamColorTileData(searchTilesets, name, shape, teamColor, out fps, out Tile[] tiles))
コード例 #4
0
        public bool GetTeamColorTileData(IEnumerable <string> searchTilesets, string name, int shape, TeamColor teamColor, out int fps, out Tile[] tiles)
        {
            fps   = 0;
            tiles = null;

            foreach (var tileset in tilesets.Join(searchTilesets, x => x.Key, y => y, (x, y) => x.Value))
            {
                if (tileset.GetTileData(name, shape, teamColor, out fps, out tiles))
                {
                    return(true);
                }
            }

            return(false);
        }