Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultRealm"/> class.
        /// </summary>
        public DefaultRealm(IWorld world, TimeOfDay worldTimeOfDay)
        {
            ExceptionFactory
                .ThrowIf<ArgumentNullException>(world == null, "A valid world instance must be supplied.")
                .Or(worldTimeOfDay == null, "A valid TImeOfDay instance is required to initialize a realm.");

            this.World = world;
            this.timeOfDayStateManager = new TimeOfDayStateManager(world.TimeOfDayStates);
            this.ApplyTimeZoneOffset(worldTimeOfDay);

            this.CreationDate = DateTime.Now;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultRealm"/> class.
        /// </summary>
        public DefaultRealm(IWorld world, TimeOfDay worldTimeOfDay)
        {
            ExceptionFactory
            .ThrowIf <ArgumentNullException>(world == null, "A valid world instance must be supplied.")
            .Or(worldTimeOfDay == null, "A valid TImeOfDay instance is required to initialize a realm.");

            this.World = world;
            this.timeOfDayStateManager = new TimeOfDayStateManager(world.TimeOfDayStates);
            this.ApplyTimeZoneOffset(worldTimeOfDay);

            this.CreationDate = DateTime.Now;
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultWorld"/> class.
        /// </summary>
        public DefaultWorld()
        {
            this.CreationDate = DateTime.Now;

            // Set the in-game day to be 24 hours, with each day taking 45 real-world minutes to cycle.
            this.HoursPerDay = 24;
            this.GameDayToRealHourRatio = 0.75;

            // Set up default states for the time of day.
            this.timeOfDayStates = new List<TimeOfDayState>();
            this.timeOfDayStateManager = new TimeOfDayStateManager(this.timeOfDayStates);

            // Must be in the constructor. If assigned within the Initialization method
            // the property could potentially never be restored properly from the data store.
            this.CreationDate = DateTime.Now;
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultWorld"/> class.
        /// </summary>
        public DefaultWorld()
        {
            this.CreationDate = DateTime.Now;

            // Set the in-game day to be 24 hours, with each day taking 45 real-world minutes to cycle.
            this.HoursPerDay            = 24;
            this.GameDayToRealHourRatio = 0.75;

            // Set up default states for the time of day.
            this.timeOfDayStates       = new List <TimeOfDayState>();
            this.timeOfDayStateManager = new TimeOfDayStateManager(this.timeOfDayStates);

            // Must be in the constructor. If assigned within the Initialization method
            // the property could potentially never be restored properly from the data store.
            this.CreationDate = DateTime.Now;
        }