public GameTextManager(MegafileManager megafileManager, string gameTextFile) { using (var stream = megafileManager.Open(gameTextFile)) using (var reader = new BinaryReader(stream)) using (var unicodeReader = new BinaryReader(stream, Encoding.Unicode)) using (var asciiReader = new BinaryReader(stream, Encoding.ASCII)) { var numStrings = reader.ReadUInt32(); var stringSizes = new (uint textSize, uint idSize)[numStrings];
public TilesetManager(MegafileManager megafileManager, TextureManager textureManager, string xmlPath, string texturesPath) { this.megafileManager = megafileManager; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(megafileManager.Open(xmlPath)); foreach (XmlNode fileNode in xmlDoc.SelectNodes("TilesetFiles/File")) { var xmlFile = Path.Combine(Path.GetDirectoryName(xmlPath), fileNode.InnerText); XmlDocument fileXmlDoc = new XmlDocument(); fileXmlDoc.Load(megafileManager.Open(xmlFile)); foreach (XmlNode tilesetNode in fileXmlDoc.SelectNodes("Tilesets/TilesetTypeClass")) { var tileset = new Tileset(textureManager); tileset.Load(tilesetNode.OuterXml, texturesPath); tilesets[tilesetNode.Attributes["name"].Value] = tileset; } } }
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(); } }