public SaveData(byte[] data) : this() { BinaryReader file = new BinaryReader(new MemoryStream(data)); file.ReadInt32(); PlayTime = file.ReadUInt32(); for (int i = 0; i < 32; i++) LevelScores[i] = file.ReadInt32(); for (int i = 0; i < 28; i++) LevelTimes[i] = new LevelTime(file.ReadBytes(LevelTime.Size)); for (int i = 0; i < 4; i++) for (int j = 0; j < 3; j++) LevelWeights[i][j] = file.ReadUInt16(); file.BaseStream.Seek(0x104, SeekOrigin.Begin); for (int i = 0; i < 32; i++) LevelRings[i] = file.ReadInt16(); for (int i = 0; i < 2; i++) for (int j = 0; j < 3; j++) SkyChase1Scores[i][j] = file.ReadInt32(); for (int i = 0; i < 2; i++) for (int j = 0; j < 3; j++) SkyChase2Scores[i][j] = file.ReadInt32(); for (int i = 0; i < 2; i++) for (int j = 0; j < 3; j++) IceCapScores[i][j] = file.ReadInt32(); for (int i = 0; i < 2; i++) for (int j = 0; j < 3; j++) SandHillScores[i][j] = file.ReadInt32(); for (int i = 0; i < 3; i++) HedgehogHammerScores[i] = file.ReadInt32(); for (int i = 0; i < 6; i++) TwinkleCircuitTimes[i] = new CircuitData(file.ReadBytes(CircuitData.Size)); for (int i = 0; i < 6; i++) for (int j = 0; j < 3; j++) BossTimes[i][j] = new LevelTime(file.ReadBytes(LevelTime.Size)); Emblems = new BitArray(file.ReadBytes(17)); byte options = file.ReadByte(); MessageOption = (MessageOptions)((options >> 1) & 1); VoiceLanguage = (VoiceLanguages)((options >> 2) & 3); TextLanguage = (TextLanguages)((options >> 4) & 7); for (int i = 0; i < 7; i++) Lives[i] = file.ReadSByte(); LastCharacter = file.ReadByte(); Rumble = file.ReadBoolean(); file.ReadByte(); LastLevel = file.ReadInt16(); file.ReadInt16(); EventFlags = new BitArray(file.ReadBytes(64)); NPCFlags = new BitArray(file.ReadBytes(64)); file.BaseStream.Seek(0x2E8, SeekOrigin.Begin); for (int i = 0; i < 8; i++) AdventureModeData[i] = new AdventureData(file.ReadBytes(AdventureData.Size)); for (int i = 0; i < 8; i++) LevelClearCounts[i] = file.ReadBytes(43); for (int i = 0; i < 60; i++) Missions[i] = new MissionStatus(file.ReadByte()); BlackMarketRings = file.ReadInt32(); for (int i = 0; i < 10; i++) MetalLevelScores[i] = file.ReadInt32(); for (int i = 0; i < 10; i++) MetalLevelTimes[i] = new LevelTime(file.ReadBytes(LevelTime.Size)); for (int i = 0; i < 10; i++) MetalLevelRings[i] = file.ReadInt16(); file.ReadInt16(); for (int i = 0; i < 3; i++) MetalIceCapScores[i] = file.ReadInt32(); for (int i = 0; i < 3; i++) MetalSandHillScores[i] = file.ReadInt32(); MetalTwinkleCircuitTimes = new CircuitData(file.ReadBytes(CircuitData.Size)); for (int i = 0; i < 3; i++) MetalBossTimes[i] = new LevelTime(file.ReadBytes(LevelTime.Size)); MetalEmblems = new BitArray(file.ReadBytes(4)); file.Close(); }
public SaveData(byte[] data) : this() { BinaryReader file = new BinaryReader(new MemoryStream(data)); file.ReadInt32(); PlayTime = file.ReadUInt32(); for (int i = 0; i < 32; i++) { LevelScores[i] = file.ReadInt32(); } for (int i = 0; i < 28; i++) { LevelTimes[i] = new LevelTime(file.ReadBytes(LevelTime.Size)); } for (int i = 0; i < 4; i++) { for (int j = 0; j < 3; j++) { LevelWeights[i][j] = file.ReadUInt16(); } } file.BaseStream.Seek(0x104, SeekOrigin.Begin); for (int i = 0; i < 32; i++) { LevelRings[i] = file.ReadInt16(); } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { SkyChase1Scores[i][j] = file.ReadInt32(); } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { SkyChase2Scores[i][j] = file.ReadInt32(); } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { IceCapScores[i][j] = file.ReadInt32(); } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { SandHillScores[i][j] = file.ReadInt32(); } } for (int i = 0; i < 3; i++) { HedgehogHammerScores[i] = file.ReadInt32(); } for (int i = 0; i < 6; i++) { TwinkleCircuitTimes[i] = new CircuitData(file.ReadBytes(CircuitData.Size)); } for (int i = 0; i < 6; i++) { for (int j = 0; j < 3; j++) { BossTimes[i][j] = new LevelTime(file.ReadBytes(LevelTime.Size)); } } Emblems = new BitArray(file.ReadBytes(17)); byte options = file.ReadByte(); MessageOption = (MessageOptions)((options >> 1) & 1); VoiceLanguage = (VoiceLanguages)((options >> 2) & 3); TextLanguage = (TextLanguages)((options >> 4) & 7); for (int i = 0; i < 7; i++) { Lives[i] = file.ReadSByte(); } LastCharacter = file.ReadByte(); Rumble = file.ReadBoolean(); file.ReadByte(); LastLevel = file.ReadInt16(); file.ReadInt16(); EventFlags = new BitArray(file.ReadBytes(64)); NPCFlags = new BitArray(file.ReadBytes(64)); file.BaseStream.Seek(0x2E8, SeekOrigin.Begin); for (int i = 0; i < 8; i++) { AdventureModeData[i] = new AdventureData(file.ReadBytes(AdventureData.Size)); } for (int i = 0; i < 8; i++) { LevelClearCounts[i] = file.ReadBytes(43); } for (int i = 0; i < 60; i++) { Missions[i] = new MissionStatus(file.ReadByte()); } BlackMarketRings = file.ReadInt32(); for (int i = 0; i < 10; i++) { MetalLevelScores[i] = file.ReadInt32(); } for (int i = 0; i < 10; i++) { MetalLevelTimes[i] = new LevelTime(file.ReadBytes(LevelTime.Size)); } for (int i = 0; i < 10; i++) { MetalLevelRings[i] = file.ReadInt16(); } file.ReadInt16(); for (int i = 0; i < 3; i++) { MetalIceCapScores[i] = file.ReadInt32(); } for (int i = 0; i < 3; i++) { MetalSandHillScores[i] = file.ReadInt32(); } MetalTwinkleCircuitTimes = new CircuitData(file.ReadBytes(CircuitData.Size)); for (int i = 0; i < 3; i++) { MetalBossTimes[i] = new LevelTime(file.ReadBytes(LevelTime.Size)); } MetalEmblems = new BitArray(file.ReadBytes(4)); file.Close(); }
public SaveData() { LevelScores = new int[32]; LevelTimes = new LevelTime[28]; for (int i = 0; i < 28; i++) LevelTimes[i] = new LevelTime(); LevelWeights = new ushort[4][]; for (int i = 0; i < 4; i++) LevelWeights[i] = new ushort[3]; LevelRings = new short[32]; SkyChase1Scores = new int[2][]; for (int i = 0; i < 2; i++) SkyChase1Scores[i] = new int[3]; SkyChase2Scores = new int[2][]; for (int i = 0; i < 2; i++) SkyChase2Scores[i] = new int[3]; IceCapScores = new int[2][]; for (int i = 0; i < 2; i++) IceCapScores[i] = new int[3]; SandHillScores = new int[2][]; for (int i = 0; i < 2; i++) SandHillScores[i] = new int[3]; HedgehogHammerScores = new int[3]; TwinkleCircuitTimes = new CircuitData[6]; for (int i = 0; i < 6; i++) TwinkleCircuitTimes[i] = new CircuitData(); BossTimes = new LevelTime[6][]; for (int i = 0; i < 6; i++) BossTimes[i] = new LevelTime[3]; Emblems = new BitArray(136); Lives = new sbyte[7]; EventFlags = new BitArray(512); NPCFlags = new BitArray(512); AdventureModeData = new AdventureData[8]; for (int i = 0; i < 8; i++) AdventureModeData[i] = new AdventureData(); LevelClearCounts = new byte[8][]; for (int i = 0; i < 8; i++) LevelClearCounts[i] = new byte[43]; Missions = new MissionStatus[60]; for (int i = 0; i < 60; i++) Missions[i] = new MissionStatus(); MetalLevelScores = new int[10]; MetalLevelTimes = new LevelTime[10]; for (int i = 0; i < 10; i++) MetalLevelTimes[i] = new LevelTime(); MetalLevelRings = new short[10]; MetalIceCapScores = new int[3]; MetalSandHillScores = new int[3]; MetalTwinkleCircuitTimes = new CircuitData(); MetalBossTimes = new LevelTime[3]; MetalEmblems = new BitArray(32); }
public SaveData() { LevelScores = new int[32]; LevelTimes = new LevelTime[28]; for (int i = 0; i < 28; i++) { LevelTimes[i] = new LevelTime(); } LevelWeights = new ushort[4][]; for (int i = 0; i < 4; i++) { LevelWeights[i] = new ushort[3]; } LevelRings = new short[32]; SkyChase1Scores = new int[2][]; for (int i = 0; i < 2; i++) { SkyChase1Scores[i] = new int[3]; } SkyChase2Scores = new int[2][]; for (int i = 0; i < 2; i++) { SkyChase2Scores[i] = new int[3]; } IceCapScores = new int[2][]; for (int i = 0; i < 2; i++) { IceCapScores[i] = new int[3]; } SandHillScores = new int[2][]; for (int i = 0; i < 2; i++) { SandHillScores[i] = new int[3]; } HedgehogHammerScores = new int[3]; TwinkleCircuitTimes = new CircuitData[6]; for (int i = 0; i < 6; i++) { TwinkleCircuitTimes[i] = new CircuitData(); } BossTimes = new LevelTime[6][]; for (int i = 0; i < 6; i++) { BossTimes[i] = new LevelTime[3]; } Emblems = new BitArray(136); Lives = new sbyte[7]; EventFlags = new BitArray(512); NPCFlags = new BitArray(512); AdventureModeData = new AdventureData[8]; for (int i = 0; i < 8; i++) { AdventureModeData[i] = new AdventureData(); } LevelClearCounts = new byte[8][]; for (int i = 0; i < 8; i++) { LevelClearCounts[i] = new byte[43]; } Missions = new MissionStatus[60]; for (int i = 0; i < 60; i++) { Missions[i] = new MissionStatus(); } MetalLevelScores = new int[10]; MetalLevelTimes = new LevelTime[10]; for (int i = 0; i < 10; i++) { MetalLevelTimes[i] = new LevelTime(); } MetalLevelRings = new short[10]; MetalIceCapScores = new int[3]; MetalSandHillScores = new int[3]; MetalTwinkleCircuitTimes = new CircuitData(); MetalBossTimes = new LevelTime[3]; MetalEmblems = new BitArray(32); }