Esempio n. 1
0
 /// <summary>
 /// Default Constructor to setup the initial room state.
 /// </summary>
 public Room()
 {
     Name           = string.Empty;
     Description    = string.Empty;
     LightsOn       = true;
     DroppedObjects = new DroppedObjects(Game);
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor to setup the initial room state.
 /// </summary>
 /// <param name="roomExits">This object contains the references to the exits for the room which define what
 /// rooms the exits point too.</param>
 /// <param name="game">An instance of the main Game object.</param>
 public Room(IRoomExits roomExits, IGame game)
 {
     Name           = string.Empty;
     Description    = string.Empty;
     _roomExits     = roomExits;
     Game           = game;
     LightsOn       = true;
     DroppedObjects = new DroppedObjects(Game);
 }
Esempio n. 3
0
        /// <summary>
        /// Constructor to setup the initial room state.
        /// </summary>
        /// <param name="name">Name of the room.</param>
        /// <param name="description">Description of the room.</param>
        /// <param name="game">Reference to the game object.</param>
        /// <exception cref="ArgumentNullException">If the name or description are null or empty then throw
        /// an ArgumentNullException.</exception>
        public Room(string name, string description, IGame game)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(Name), "The room name can not be empty.");
            }

            if (string.IsNullOrEmpty(description))
            {
                throw new ArgumentNullException(nameof(Description), "The room description can not be empty.");
            }

            Name           = name;
            Description    = description;
            Game           = game;
            LightsOn       = true;
            DroppedObjects = new DroppedObjects(Game);
        }