Exemplo n.º 1
0
        /// <summary>
        /// Clone this object
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            var clone = new GameTimeData();

            clone.Date = (GameDate)Date.Clone();
            clone.Step = Step;
            return(clone);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Restore the state of this object from the current savegame.
        /// </summary>
        private void LoadState()
        {
            var saveGame = SaveGameSystem.Instance.GetCurrentSaveGame();

            data = saveGame.gameTime;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initialize the default state.
 /// </summary>
 private void Initialize()
 {
     data = new GameTimeData();
 }