desert portal
This commit is contained in:
@@ -15,7 +15,31 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
public bool IsEntrance => IsType((ModuleType)DoorType.Entrance);
|
||||
public bool IsExit => IsType((ModuleType)DoorType.Exit);
|
||||
|
||||
internal DoorState DoorState => DoorState.FromState(State);
|
||||
public DoorState DoorState => DoorState.FromState(State);
|
||||
public DoorState ConnectedDoorState => Passage.Other(this).DoorState;
|
||||
|
||||
/// <summary>
|
||||
/// Once this property is set, the door is considered to be connected. This property must only be set once.
|
||||
/// </summary>
|
||||
internal Passage Passage
|
||||
{
|
||||
get => _passage;
|
||||
set
|
||||
{
|
||||
if (_passage != null)
|
||||
{
|
||||
throw new EngineException($"{this} is already connected");
|
||||
}
|
||||
|
||||
_passage = value;
|
||||
if (State != null)
|
||||
{
|
||||
DoorState.Connect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Passage _passage;
|
||||
|
||||
internal DoorModule(Space space, DoorModuleDescription description) : base(space, description) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user