/// <summary> /// Clone this object /// </summary> /// <returns></returns> public object Clone() { var clone = new GameTimeData(); clone.Date = (GameDate)Date.Clone(); clone.Step = Step; return(clone); }
/// <summary> /// Get the difference between this date and another given date in timesteps. /// </summary> /// <param name="other"></param> /// <returns></returns> public int TimeStepDifference(GameTimeData other) { int difference = other.Step - Step; var dayDifference = (int)(other.Date.DateTime - Date.DateTime).TotalDays; difference += dayDifference * GameTime.Instance.ClockSteps; return(difference); }
/// <summary> /// Restore the state of this object from the current savegame. /// </summary> private void LoadState() { var saveGame = SaveGameSystem.Instance.GetCurrentSaveGame(); data = saveGame.gameTime; }
/// <summary> /// Initialize the default state. /// </summary> private void Initialize() { data = new GameTimeData(); }