Beispiel #1
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);
        }
        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);
        }
Beispiel #3
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);
        }