public static BangHomeCityManager Load(BangChunkReader <BangDataHeader> chunkReader) { BangHomeCityManager bangHomeCityManager = new BangHomeCityManager(); chunkReader.ReadExpectedTag(0x4853); bangHomeCityManager.Version = chunkReader.ReadUInt32(); bangHomeCityManager.UnkDword4 = chunkReader.ReadInt32(); // Only in Age3 if (chunkReader.Header.GameTarget == BangGameTarget.AgeOfEmpires3) { int numOfHomeCity = chunkReader.ReadInt32(); for (int i = 0; i < numOfHomeCity; i++) { bangHomeCityManager.HomeCities.Add(BangHomeCity.Load(chunkReader)); } } return(bangHomeCityManager); }
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); }