/// <summary> /// Set Challenges to specified state, be sure to call Save after to keep changes! /// </summary> /// <param name="State">What State To Set The Challenges To</param> /// <seealso cref="Save()" /> public void SetAllChallenges(DeulistChallengeState State) { for (var Counter = 0; Counter < Misc.Challenges.Length; Counter++) { Misc.Challenges[Counter] = State; } }
public void SetAllChallenges(DeulistChallengeState state) { for (int i = 0; i < Misc.Challenges.Length; i++) { Misc.Challenges[i] = state; } }
public MiscSaveData(GameSaveData owner) : base(owner) { Challenges = new DeulistChallengeState[Constants.GetNumDeckDataSlots(Version)]; UnlockedRecipes = new bool[Constants.GetNumDeckDataSlots(Version)]; UnlockedAvatars = new bool[153]; }
public override void Load(BinaryReader reader) { // 64 starting bytes reader.ReadBytes(16); // DP is treated as a long in save data DuelPoints = (int)reader.ReadInt64(); byte[] unlockedAvatarsBuffer = reader.ReadBytes(32); for (int i = 0; i < UnlockedAvatars.Length; i++) { int byteIndex = i / 8; int bitIndex = i % 8; UnlockedAvatars[i] = (unlockedAvatarsBuffer[byteIndex] & (byte)(1 << bitIndex)) != 0; } for (int i = 0; i < Constants.GetNumDeckDataSlots(Version); i++) { DeulistChallengeState challenge = (DeulistChallengeState)reader.ReadInt32(); if (i < Challenges.Length) { Challenges[i] = challenge; } } byte[] unlockedRecipesBuffer = reader.ReadBytes(GetRecipeBufferBytes()); for (int i = 0; i < Constants.GetNumDeckDataSlots(Version); i++) { int byteIndex = i / 8; int bitIndex = i % 8; UnlockedRecipes[i] = (unlockedRecipesBuffer[byteIndex] & (byte)(1 << bitIndex)) != 0; } UnlockedShopPacks = (UnlockedShopPacks)reader.ReadUInt32(); UnlockedBattlePacks = (UnlockedBattlePacks)reader.ReadUInt32(); reader.ReadBytes(8); CompleteTutorials = (CompleteTutorials)reader.ReadInt32(); UnlockedContent = (UnlockedContent)reader.ReadInt32(); }
public MiscSaveData() { Challenges = new DeulistChallengeState[Constants.NumDeckDataSlots]; UnlockedRecipes = new bool[Constants.NumDeckDataSlots]; UnlockedAvatars = new bool[153]; }