requirements foundation
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using Escape_Room_Engine.Engine.Scripts.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Requirements
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Requirements/Place Along Space Edges")]
|
||||
public class PlaceAlongSpaceEdges : PlacementRequirement
|
||||
{
|
||||
public override HashSet<Vector2Int> PlacementCandidates(Module module, Space space)
|
||||
{
|
||||
var edgePositions = new HashSet<Vector2Int>();
|
||||
|
||||
for (var x = 0; x < space.rrDimensions.width; x++)
|
||||
{
|
||||
edgePositions.Add(new Vector2Int(x, 0));
|
||||
edgePositions.Add(new Vector2Int(x, space.rrDimensions.length));
|
||||
}
|
||||
for (var z = 0; z < space.rrDimensions.length; z++)
|
||||
{
|
||||
edgePositions.Add(new Vector2Int(0, z));
|
||||
edgePositions.Add(new Vector2Int(space.rrDimensions.width, z));
|
||||
}
|
||||
|
||||
return edgePositions;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ec2cdf0145347e18e7c68221333be2c
|
||||
timeCreated: 1667876484
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using Escape_Room_Engine.Engine.Scripts.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Requirements
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Requirements/Place Anywhere")]
|
||||
public class PlaceAnywhere : PlacementRequirement
|
||||
{
|
||||
public override HashSet<Vector2Int> PlacementCandidates(Module module, Space space)
|
||||
{
|
||||
return space.rrDimensions.EveryPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa4ff365b4e844e782cd12d8aeebd3d4
|
||||
timeCreated: 1667876850
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using Escape_Room_Engine.Engine.Scripts.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Requirements
|
||||
{
|
||||
public abstract class PlacementRequirement : Requirement
|
||||
{
|
||||
public abstract HashSet<Vector2Int> PlacementCandidates(Module module, Space space);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65f297b8d32b4f09b89c21b88b43b646
|
||||
timeCreated: 1667876036
|
||||
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Escape_Room_Engine.Engine.Scripts.Requirements
|
||||
{
|
||||
public abstract class Requirement : ScriptableObject
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9123b592f74444c8b6225f725b6407b3
|
||||
timeCreated: 1667874140
|
||||
Reference in New Issue
Block a user