comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -5,9 +5,18 @@ using LogType = EscapeRoomEngine.Engine.Runtime.Utilities.LogType;
namespace EscapeRoomEngine.Engine.Runtime
{
/// <summary>
/// The passage handles the two door modules that connect two spaces.
/// </summary>
public class Passage
{
/// <summary>
/// The exit door in the previous room.
/// </summary>
internal readonly DoorModule fromOut;
/// <summary>
/// The entrance door in the next room.
/// </summary>
internal DoorModule toIn;
internal Passage(DoorModule from)
@@ -20,6 +29,9 @@ namespace EscapeRoomEngine.Engine.Runtime
fromOut = from;
}
/// <summary>
/// Place an entrance door in the same position relative to the room origin as the exit door.
/// </summary>
internal void PlaceEntrance(DoorModule door)
{
if (!door.IsEntrance)
@@ -35,6 +47,9 @@ namespace EscapeRoomEngine.Engine.Runtime
Logger.Log($"Placed entrance {toIn} at {toIn.RrPosition} (RR)", LogType.ModulePlacement);
}
/// <summary>
/// Connect the two doors in this passage.
/// </summary>
internal void ConnectDoors()
{
toIn.Passage = this;
@@ -43,6 +58,9 @@ namespace EscapeRoomEngine.Engine.Runtime
Logger.Log($"Connected passage from {fromOut} to {toIn}", LogType.PassageConnection);
}
/// <summary>
/// Return the door connected to a given door in this passage.
/// </summary>
internal DoorModule Other(DoorModule of)
{
if (of.Equals(fromOut))