public void Deserialize(DataSerializer s) { Singleton <LoadingManager> .instance.m_loadingProfilerSimulation.BeginDeserialize(s, "GameAreaManager"); GameAreaManager instance = Singleton <GameAreaManager> .instance; //begin mod instance.m_areaGrid = new int[AREAGRID_RESOLUTION * AREAGRID_RESOLUTION]; //end mod int[] numArray = instance.m_areaGrid; int length = numArray.Length; instance.m_areaCount = (int)s.ReadUInt8(); //begin mod instance.m_maxAreaCount = AREAGRID_RESOLUTION * AREAGRID_RESOLUTION; //end mod _startTileField.SetValue(instance, s.version < 137U ? 12 : (int)s.ReadUInt8()); EncodedArray.Byte @byte = EncodedArray.Byte.BeginRead(s); for (int index = 0; index < length; ++index) { numArray[index] = (int)@byte.Read(); } @byte.EndRead(); instance.m_areaNotUnlocked = s.version < 87U ? (GenericGuide)null : s.ReadObject <GenericGuide>(); if (s.version >= 199U) { _fieldInfo1.SetValue(instance, s.ReadFloat()); _fieldInfo2.SetValue(instance, s.ReadFloat()); _fieldInfo3.SetValue(instance, s.ReadFloat()); _fieldInfo4.SetValue(instance, s.ReadFloat()); } else { _fieldInfo1.SetValue(instance, -1f); _fieldInfo2.SetValue(instance, -1f); _fieldInfo3.SetValue(instance, -1f); _fieldInfo4.SetValue(instance, -1f); } if (s.version >= 112032U && !RecoveryMode) { var instanceSavedCameraView = (CameraController.SavedCameraView)_fieldInfo5.GetValue(instance); instanceSavedCameraView.Deserialize(s); } else { RecoveryMode = false; var instanceSavedCameraView = new CameraController.SavedCameraView(); instanceSavedCameraView.m_mode = -1; _fieldInfo5.SetValue(instance, instanceSavedCameraView); } Singleton <LoadingManager> .instance.m_loadingProfilerSimulation.EndDeserialize(s, "GameAreaManager"); }
public void Deserialize(DataSerializer s) { var districtGrid = new DistrictManager.Cell[GRID * GRID]; EncodedArray.Byte @byte = EncodedArray.Byte.BeginRead(s); int num2 = districtGrid.Length; for (int num21 = 0; num21 < num2; num21++) { districtGrid[num21].m_district1 = @byte.Read(); } for (int num22 = 0; num22 < num2; num22++) { districtGrid[num22].m_district2 = @byte.Read(); } for (int num23 = 0; num23 < num2; num23++) { districtGrid[num23].m_district3 = @byte.Read(); } for (int num24 = 0; num24 < num2; num24++) { districtGrid[num24].m_district4 = @byte.Read(); } for (int num25 = 0; num25 < num2; num25++) { districtGrid[num25].m_alpha1 = @byte.Read(); } for (int num26 = 0; num26 < num2; num26++) { districtGrid[num26].m_alpha2 = @byte.Read(); } for (int num27 = 0; num27 < num2; num27++) { districtGrid[num27].m_alpha3 = @byte.Read(); } for (int num28 = 0; num28 < num2; num28++) { districtGrid[num28].m_alpha4 = @byte.Read(); } @byte.EndRead(); FakeDistrictManager.districtGrid = districtGrid; }