* Door.cs AvailableTravelDirections enum added to the constructor arguments. Doors now require a TravelDirection to be specified as an argument when instanced. Room Designer: * frmMain.cs - renamed door field to _CurrentDoor. * frmMain.cs - renamed room field to _CurrentRoom. * frmMain.cs - Added detailed commenting. * frmMain.cs - Doorways can now be installed and uninstalled from a room. While it was available within the editor, it was not implemented fully until now. * frmMain.cs - Removed most of the doorway management code from the propertyDoor_PropertyValueChanged method, and broke the code down into several smaller methods for easier maintenance. * frmMain.cs - Added InstallDoor() method for installing doorways from rooms. * frmMain.cs - Added UninstallDoor() method for uninstalling doorways from rooms. * frmMain.cs - Added GetDirection() method, converts a string representation of a TravelDirection into an actual TravelDirection enum value for use with creating a Door.
62 lines
1.3 KiB
C#
62 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
using System.ComponentModel;
|
|
|
|
namespace MUDEngine.Objects.Environment
|
|
{
|
|
public class Door
|
|
{
|
|
public enum AvailableDoorStates
|
|
{
|
|
Uninstalled,
|
|
Installed,
|
|
}
|
|
|
|
[Category("Door Settings")]
|
|
[DefaultValue(false)]
|
|
public bool IsLocked
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Category("Door Settings")]
|
|
public string RequiredKey
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Category("Door Settings")]
|
|
[DefaultValue(0)]
|
|
public int LevelRequirement
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Category("Door Settings")]
|
|
[Description("Sets if the door is installed and useable within the room or not.")]
|
|
[DefaultValue(AvailableDoorStates.Uninstalled)]
|
|
public AvailableDoorStates DoorState
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public AvailableTravelDirections TravelDirection
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public Door(AvailableTravelDirections TravelDirection)
|
|
{
|
|
this.TravelDirection = TravelDirection;
|
|
}
|
|
}
|
|
}
|