Exemplo n.º 1
0
        public static BangColor Read <T>(BangChunkReader <T> reader)
        {
            BangColor ret;

            ret.R = reader.ReadFloat();
            ret.G = reader.ReadFloat();
            ret.B = reader.ReadFloat();

            return(ret);
        }
Exemplo n.º 2
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);
        }