module relations and module staging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EscapeRoomEngine.Engine.Runtime.Requirements;
|
||||
using EscapeRoomEngine.Engine.Runtime.Utilities;
|
||||
using UnityEngine;
|
||||
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
|
||||
@@ -21,6 +22,9 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
Orientation.North, Orientation.East, Orientation.South, Orientation.West
|
||||
});
|
||||
|
||||
public readonly List<Module> relatedModules = new();
|
||||
|
||||
public ModuleState State { get; private set; }
|
||||
/// <summary>
|
||||
/// Get the space relative (<i>SR</i>) position of this module.
|
||||
/// </summary>
|
||||
@@ -29,7 +33,6 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
/// Get the room relative (<i>RR</i>) position of this module.
|
||||
/// </summary>
|
||||
internal Vector2Int RrPosition => space.ToRoomRelative(SrPosition);
|
||||
internal ModuleState State { get; private set; }
|
||||
|
||||
internal readonly ModuleDescription description;
|
||||
internal Orientation orientation;
|
||||
@@ -52,6 +55,13 @@ namespace EscapeRoomEngine.Engine.Runtime.Modules
|
||||
return description.types.Contains(type);
|
||||
}
|
||||
|
||||
internal bool CheckRequirements()
|
||||
{
|
||||
return PreconditionRequirement.CheckPreconditions(this, space) &&
|
||||
PlacementRequirement.TryPlacing(this, space) &&
|
||||
OrientationRequirement.TryOrienting(this, space);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place this module with a position relative to the room.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user