예제 #1
0
        public static BangDataHeader Load(BangChunkReader <BangDataHeader> chunkReader, BangGameTarget target, BangGameType type)
        {
            BangDataHeader header = new BangDataHeader();

            chunkReader.ReadExpectedTag(0x4742);
            header.FileVersion        = chunkReader.ReadInt32();
            header.VersionInformation = header.FileVersion >= 25 ? chunkReader.ReadString() : "Unknown";

            var lenUnkArray = header.FileVersion >= 4 ? chunkReader.ReadInt32() : 0;

            header.UnkCArray = chunkReader.ReadASCIIString(lenUnkArray);

            if (header.FileVersion >= 23)
            {
                int unkLangId = chunkReader.ReadInt32(); // TODO: This is lang id --> would need to load lang xml files
                header.UnkStr = chunkReader.ReadString();
            }

            if (header.FileVersion >= 33)
            {
                header.IsMultiplayerSave = chunkReader.ReadBoolean();
            }

            chunkReader.Header            = header;
            chunkReader.Header.GameTarget = target;
            chunkReader.Header.GameType   = type;

            return(header);
        }
예제 #2
0
        public static BangHomeCityPreservedCard Load(BangChunkReader <BangDataHeader> chunkReader)
        {
            BangHomeCityPreservedCard bangHomeCityPreservedCard = new BangHomeCityPreservedCard();

            chunkReader.ReadExpectedTag(0x6463);

            bangHomeCityPreservedCard.Version = chunkReader.ReadUInt32();
            bangHomeCityPreservedCard.Name    = chunkReader.ReadString();
            bangHomeCityPreservedCard.ID      = chunkReader.ReadInt32();

            return(bangHomeCityPreservedCard);
        }
예제 #3
0
        public static BangHomeCityDeck Load(BangChunkReader <BangDataHeader> chunkReader)
        {
            BangHomeCityDeck bangHomeCityDeck = new BangHomeCityDeck();

            chunkReader.ReadExpectedTag(0x6B44);

            bangHomeCityDeck.Version = chunkReader.ReadUInt32();
            bangHomeCityDeck.ID      = chunkReader.ReadInt32();
            bangHomeCityDeck.Name    = chunkReader.ReadString();
            if (bangHomeCityDeck.Version > 2)
            {
                bangHomeCityDeck.GameID = chunkReader.ReadInt32();
            }

            if (bangHomeCityDeck.Version > 0)
            {
                bangHomeCityDeck.IsDefault = chunkReader.ReadBoolean();
            }

            int numOfUnkArray10 = chunkReader.ReadInt32();

            for (int i = 0; i < numOfUnkArray10; i++)
            {
                bangHomeCityDeck.TechIDs.Add(chunkReader.ReadInt32());
            }

            if (bangHomeCityDeck.Version > 1)
            {
                int numOfCards = chunkReader.ReadInt32();
                for (int i = 0; i < numOfCards; i++)
                {
                    bangHomeCityDeck.Cards.Add(BangHomeCityCard.Load(chunkReader));
                }
            }

            if (bangHomeCityDeck.Version > 3)
            {
                int numOfPreservedCards = chunkReader.ReadInt32();
                for (int i = 0; i < numOfPreservedCards; i++)
                {
                    bangHomeCityDeck.PreservedCards.Add(BangHomeCityPreservedCard.Load(chunkReader));
                }
            }


            return(bangHomeCityDeck);
        }
예제 #4
0
        public static BangHomeCity Load(BangChunkReader <BangDataHeader> chunkReader)
        {
            BangHomeCity bangHomeCity = new BangHomeCity();

            chunkReader.ReadExpectedTag(0x4853);

            bangHomeCity.Version = chunkReader.ReadUInt32();

            bangHomeCity.CivName     = chunkReader.ReadString();
            bangHomeCity.DataLoc     = chunkReader.ReadEnum <BangHomeCityDataLocation>();
            bangHomeCity.Filename    = chunkReader.ReadString();
            bangHomeCity.Type        = chunkReader.ReadString();
            bangHomeCity.Description = chunkReader.ReadString();
            bangHomeCity.HeroName    = chunkReader.ReadString();

            if (bangHomeCity.Version >= 2)
            {
                int numOfUnk = chunkReader.ReadInt32();
                for (int i = 0; i < numOfUnk; i++)
                {
                    bangHomeCity.UnkStrList.Add(chunkReader.ReadString());
                }
            }

            bangHomeCity.HeroDogName = chunkReader.ReadString();
            bangHomeCity.ShipName    = chunkReader.ReadString();
            bangHomeCity.ID          = chunkReader.ReadString();

            bangHomeCity.UnkByte4    = chunkReader.ReadBoolean();
            bangHomeCity.Level       = chunkReader.ReadInt32();
            bangHomeCity.NumberShips = chunkReader.ReadInt32();
            bangHomeCity.UnkDword1E4 = chunkReader.ReadInt32();
            bangHomeCity.UnkHomeCityFactorRelated = chunkReader.ReadFloat();
            bangHomeCity.NumPropUnlocksEarned     = chunkReader.ReadInt32();

            int numOfDecks = chunkReader.ReadInt32();

            for (int i = 0; i < numOfDecks; i++)
            {
                bangHomeCity.Decks.Add(BangHomeCityDeck.Load(chunkReader));
            }

            int numOfPreservedCards = chunkReader.ReadInt32();

            for (int i = 0; i < numOfPreservedCards; i++)
            {
                bangHomeCity.PreservedCards.Add(BangHomeCityPreservedCard.Load(chunkReader));
            }

            int numOfTechs = chunkReader.ReadInt32();

            for (int i = 0; i < numOfTechs; i++)
            {
                bangHomeCity.TechNames.Add(chunkReader.ReadString());
            }

            bangHomeCity.PreservedCards.Clear(); // ???
            numOfPreservedCards = chunkReader.ReadInt32();
            for (int i = 0; i < numOfPreservedCards; i++)
            {
                bangHomeCity.PreservedCards.Add(BangHomeCityPreservedCard.Load(chunkReader));
            }



            return(bangHomeCity);
        }