コード例 #1
0
 public void Save(BinaryWriter writer)
 {
     writer.Write(PlantType);
     writer.Write(GardenLocation);
     writer.Write(Column);
     writer.Write(Row);
     IOUtils.WriteUInt32Array(writer, unknown1);
     IOUtils.WriteUnixTimestamp(writer, LastWateringTime);
     writer.Write(unknown2);
     writer.Write(Color);
     writer.Write(NumTimesFertilized);
     writer.Write(NumTimesWatered);
     writer.Write(unknown3);
     writer.Write((int)NeedsPhonographOrBugSpray);
     writer.Write(unknown4);
     IOUtils.WriteUnixTimestamp(writer, LastPhonographOrBugSprayTime);
     writer.Write(unknown5);
     IOUtils.WriteUnixTimestamp(writer, LastFertilizerTime);
     IOUtils.WriteUInt32Array(writer, unknown6);
 }
コード例 #2
0
        public void Save()
        {
            using (var writer = new BinaryWriter(new FileStream(UserFilePath, FileMode.Create, FileAccess.Write)))
            {
                writer.Write(0x0C); // Version
                Level.Write(writer);
                writer.Write(moneyOver10);
                writer.Write(NumTimesAdventureModeCompleted);
                IOUtils.WriteInt32Array(writer, SurvivalModeFlags);
                IOUtils.WriteUInt32Array(writer, unknown1);
                writer.Write(StreakLengthEndlessSurvival);
                IOUtils.WriteUInt32Array(writer, unknown2);
                IOUtils.WriteBoolPreserveNonzeroArray(writer, HasMinigameTrophy, 4);
                IOUtils.WriteUInt32Array(writer, unknown3);

                writer.Write(TreeOfWisdomHeight);
                IOUtils.WriteBoolPreserveNonzeroArray(writer, HasVaseBreakerTrophy, 4);
                writer.Write(StreakLengthVaseBreakerEndless);
                IOUtils.WriteBoolPreserveNonzeroArray(writer, HasIZombieTrophy, 4);
                writer.Write(StreakLengthIZombieEndless);

                IOUtils.WriteUInt32Array(writer, unknown4);

                IOUtils.WriteBoolPreserveNonzeroArray(writer, HasShopPlant, 4);
                writer.Write(unknown5);
                for (int i = 0; i < MarigoldLastPurchased.Length; i++)
                {
                    IOUtils.WriteDaysSince2000(writer, MarigoldLastPurchased[i]);
                }
                IOUtils.WriteBoolPreserveNonzero(writer, HasGoldenWateringCan, 4);
                IOUtils.WriteInt32Offset(writer, FertilizerAmount, 1000);
                IOUtils.WriteInt32Offset(writer, BugSprayAmount, 1000);
                IOUtils.WriteBoolPreserveNonzero(writer, HasPhonograph, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, HasGardeningGlove, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, HasMushroomGarden, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, HasWheelbarrow, 4);
                IOUtils.WriteUnixTimestamp(writer, StinkyLastAwokenTime);
                writer.Write(NumberSlots - 6);
                IOUtils.WriteBoolPreserveNonzero(writer, HasPoolCleaners, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, HasRoofCleaners, 4);
                writer.Write(RakeUses);
                IOUtils.WriteBoolPreserveNonzero(writer, HasAquariumGarden, 4);
                IOUtils.WriteInt32Offset(writer, ChocolateAmount, 1000);
                IOUtils.WriteBoolPreserveNonzero(writer, TreeOfWisdomAvailable, 4);
                IOUtils.WriteInt32Offset(writer, TreeFoodAmount, 1000);
                IOUtils.WriteBoolPreserveNonzero(writer, HasWallNutFirstAid, 4);
                IOUtils.WriteUInt32Array(writer, unknown6);
                writer.Write(unknown7);
                IOUtils.WriteUnixTimestamp(writer, StinkyLastChocolateTime);
                writer.Write(StinkyXPosition);
                writer.Write(StinkyYPosition);
                IOUtils.WriteBoolPreserveNonzero(writer, MiniGamesUnlocked, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, PuzzleModeUnlocked, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, AnimateUnlockMiniGame, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, AnimateUnlockVasebreaker, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, AnimateUnlockIZombie, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, AnimateUnlockSurvival, 4);
                writer.Write(unknown8);
                IOUtils.WriteBoolPreserveNonzero(writer, ShowAdventureCompleteDialog, 4);
                IOUtils.WriteBoolPreserveNonzero(writer, HasTaco, 4);

                IOUtils.WriteUInt32Array(writer, unknown9);

                writer.Write(ZenGardenPlants.Length);
                for (int i = 0; i < ZenGardenPlants.Length; i++)
                {
                    ZenGardenPlants[i].Save(writer);
                }

                IOUtils.WriteBoolPreserveNonzeroArray(writer, HasAchievement, 2);

                IOUtils.WriteBoolPreserveNonzero(writer, AcceptedZombatarLicenseAgreement, 1);
                writer.Write(Zombatars.Length);
                for (int i = 0; i < Zombatars.Length; i++)
                {
                    Zombatars[i].Save(writer);
                }

                IOUtils.WriteUInt32Array(writer, unknown10);

                IOUtils.WriteBoolPreserveNonzero(writer, HaveCreatedZombatar, 1);

                writer.Write(trailingData);
            }
        }