connect multiple rooms with doors
This commit is contained in:
@@ -1,20 +1,44 @@
|
||||
namespace Escape_Room_Engine.Engine.Scripts
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts
|
||||
{
|
||||
public readonly struct Dimensions
|
||||
public struct Dimensions
|
||||
{
|
||||
internal Dimensions(float width, float length, float x, float y)
|
||||
internal Dimensions(int width, int length, int x, int z)
|
||||
{
|
||||
Width = width;
|
||||
Length = length;
|
||||
X = x;
|
||||
Y = y;
|
||||
this.width = width;
|
||||
this.length = length;
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public float Width { get; }
|
||||
public float Length { get; }
|
||||
public float X { get; }
|
||||
public float Y { get; }
|
||||
public int width;
|
||||
public int length;
|
||||
public int x;
|
||||
public int z;
|
||||
|
||||
public override string ToString() => $"({Width}, {Length}) at ({X}, {Y})";
|
||||
public Vector2Int Position
|
||||
{
|
||||
get => new(x, z);
|
||||
set
|
||||
{
|
||||
x = value.x;
|
||||
z = value.y;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2Int Size
|
||||
{
|
||||
get => new(width, length);
|
||||
set
|
||||
{
|
||||
width = value.x;
|
||||
length = value.y;
|
||||
}
|
||||
}
|
||||
|
||||
public int Area => width * length;
|
||||
|
||||
public override string ToString() => $"({width}, {length}) at ({x}, {z})";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user