public static TimeData InitData(Config.TimeDataConfig timeConfig) { TimeData data = new TimeData(); data.realSecondsPerDay = timeConfig.RealSecondsPerDay; data.date = new DateTime(timeConfig.OriginalYear, timeConfig.OriginalMonth, timeConfig.OriginalDay); return(data); }
/// <summary> /// Game Save /// </summary> /// <param name="saveData"></param> public void LoadPlayerSaveData(PlayerSaveData saveData, AssemblePartGeneralSaveData partSaveData) { resourceData = PlayerResourceData.LoadSave(saveData.playerSaveData_Resource); timeData = TimeData.LoadGameSave(saveData.timeSave); materialStorageData = MaterialStorageData.LoadSaveData(saveData.materialSaveData); assemblePartData = PlayerAssemblePartData.LoadSaveData(partSaveData); }
public static TimeDataSave CreateSave() { TimeDataSave data = new TimeDataSave(); TimeData time = PlayerManager.Instance.playerData.timeData; data.currentYear = time.date.Year; data.currentMonth = time.date.Month; data.currentDay = time.date.Day; data.timer = time.timer; return(data); }
public OrderStatisticsItem(int orderID, TimeData data = null, int overTime = 0) { this.orderID = orderID; if (data != null) { OrderCompleteItem item = new OrderCompleteItem { completeID = 1, completeYear = data.date.Year, completeMonth = data.date.Month }; orderCompleteData.Add(item); } OverTimeCount = overTime; }
public static TimeData LoadGameSave(TimeDataSave save) { TimeData data = new TimeData(); data.date = new DateTime(save.currentYear, save.currentMonth, save.currentDay); data.timer = save.timer; var config = Config.ConfigData.PlayerConfig.timeConfig; if (config == null) { DebugPlus.LogError("[PlayerTimeData] : Find TimeConfig Error!"); } data.realSecondsPerDay = config.RealSecondsPerDay; return(data); }
public bool InitData() { var config = Config.ConfigData.PlayerConfig; if (config == null || config.timeConfig == null) { DebugPlus.LogError("[PlayerData] : playerConfig is null!"); return(false); } timeData = TimeData.InitData(config.timeConfig); resourceData = PlayerResourceData.InitData(); assemblePartData = PlayerAssemblePartData.InitData(); materialStorageData = new MaterialStorageData(); //Init BuildPanel UnLockBuildingPanelDataList = PlayerModule.GetUnLockBuildData(); return(true); }