26 lines
743 B
C#
26 lines
743 B
C#
using UnityEngine;
|
|
|
|
namespace Escape_Room_Engine.Engine.Scripts.Modules
|
|
{
|
|
public enum DoorType
|
|
{
|
|
Entrance = ModuleType.DoorEntrance, Exit = ModuleType.DoorExit
|
|
}
|
|
|
|
public class DoorModule : Module
|
|
{
|
|
public bool IsEntrance => IsType((ModuleType)DoorType.Entrance);
|
|
public bool IsExit => IsType((ModuleType)DoorType.Exit);
|
|
|
|
internal DoorModule(DoorType type, Space space) : base(space)
|
|
{
|
|
types.Add((ModuleType)type);
|
|
srDimensions.Size = Vector2Int.one; // door always has size 1x1
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{(IsEntrance ? "Entrance" : IsExit ? "Exit" : "Unknown")} door";
|
|
}
|
|
}
|
|
} |