Exemplo n.º 1
0
        public override void OnSaveData()
        {
            if (Loader.CurrentLoadMode == LoadMode.LoadGame || Loader.CurrentLoadMode == LoadMode.NewGame)
            {
                DebugLog.LogToFileOnly("StartSave");
                //1
                var saveData = new byte[2448];
                RealCityEconomyManager.Save(ref saveData);
                _serializableData.SaveData("RealCity RealCityEconomyManager", saveData);

                //2
                saveData = new byte[131];
                MainDataStore.Save(ref saveData);
                _serializableData.SaveData("RealCity MainDataStore", saveData);

                //3
                saveData = new byte[48];
                RealCityResidentAI.Save(ref saveData);
                _serializableData.SaveData("RealCity RealCityResidentAI", saveData);

                //4
                saveData = new byte[60];
                RealCityPrivateBuildingAI.Save(ref saveData);
                _serializableData.SaveData("RealCity RealCityPrivateBuildingAI", saveData);

                //5
                saveData = new byte[4194304];
                CitizenData.Save(ref saveData);
                _serializableData.SaveData("RealCity CitizenData", saveData);

                //6
                saveData = new byte[58];
                Politics.Save(ref saveData);
                _serializableData.SaveData("RealCity Politics", saveData);

                //7
                saveData = new byte[1536];
                TransportLineData.Save(ref saveData);
                _serializableData.SaveData("RealCity TransportLineData", saveData);

                //8
                saveData = new byte[442368];
                BuildingData.Save(ref saveData);
                _serializableData.SaveData("RealCity BuildingData", saveData);

                //9
                saveData = new byte[196608];
                VehicleData.Save(ref saveData);
                _serializableData.SaveData("RealCity VehicleData", saveData);

                //10
                saveData = new byte[3145728];
                CitizenUnitData.Save(ref saveData);
                _serializableData.SaveData("RealCity CitizenUnitData", saveData);
            }
        }
Exemplo n.º 2
0
        public override void OnLoadData()
        {
            Loader.InitData();
            DebugLog.LogToFileOnly("StartLoad");
            //1
            var saveData = _serializableData.LoadData("RealCity RealCityEconomyManager");

            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity RealCityEconomyManager, please check");
            }
            else
            {
                RealCityEconomyManager.Load(ref saveData);
            }

            //2
            saveData = _serializableData.LoadData("RealCity MainDataStore");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity MainDataStore, please check");
            }
            else
            {
                MainDataStore.Load(ref saveData);
            }

            //3
            saveData = _serializableData.LoadData("RealCity RealCityResidentAI");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity RealCityResidentAI, please check");
            }
            else
            {
                RealCityResidentAI.Load(ref saveData);
            }

            //4
            saveData = _serializableData.LoadData("RealCity RealCityPrivateBuildingAI");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity RealCityPrivateBuildingAI, please check");
            }
            else
            {
                RealCityPrivateBuildingAI.Load(ref saveData);
            }

            //5
            saveData = _serializableData.LoadData("RealCity CitizenData");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity CitizenData, please check");
            }
            else
            {
                CitizenData.Load(ref saveData);
            }

            //6
            saveData = _serializableData.LoadData("RealCity Politics");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity Politics, please check");
            }
            else
            {
                Politics.Load(ref saveData);
            }

            //7
            saveData = _serializableData.LoadData("RealCity TransportLineData");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity TransportLineData, please check");
            }
            else
            {
                TransportLineData.Load(ref saveData);
            }

            //8
            saveData = _serializableData.LoadData("RealCity BuildingData");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity BuildingData, please check");
            }
            else
            {
                BuildingData.Load(ref saveData);
            }

            //9
            saveData = _serializableData.LoadData("RealCity VehicleData");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity VehicleData, please check");
            }
            else
            {
                VehicleData.Load(ref saveData);
            }

            //10
            saveData = _serializableData.LoadData("RealCity CitizenUnitData");
            if (saveData == null)
            {
                DebugLog.LogToFileOnly("no RealCity CitizenUnitData, please check");
            }
            else
            {
                CitizenUnitData.Load(ref saveData);
            }
        }