Exemplo n.º 1
0
 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;
                }
            }
        }
Exemplo n.º 3
0
 public TeamColorManager(MegafileManager megafileManager)
 {
     this.megafileManager = megafileManager;
 }