limited field creation to specified shape
This commit is contained in:
@@ -7,7 +7,26 @@ namespace Babushka.scripts.CSharp.Common.Farming;
|
||||
public partial class FieldService2D : Node2D
|
||||
{
|
||||
[Export] private Dictionary<Vector2I, FieldBehaviour2D> fields = new Dictionary<Vector2I, FieldBehaviour2D>();
|
||||
|
||||
private bool _fieldAllowed = false;
|
||||
|
||||
//Validate
|
||||
|
||||
public void MouseEnteredAllowedArea()
|
||||
{
|
||||
_fieldAllowed = true;
|
||||
}
|
||||
|
||||
public void MouseExitedAllowedArea()
|
||||
{
|
||||
_fieldAllowed = false;
|
||||
}
|
||||
|
||||
public bool FieldAllowed()
|
||||
{
|
||||
return _fieldAllowed;
|
||||
}
|
||||
|
||||
//Create
|
||||
public bool TryAddEntry(Vector2I key, FieldBehaviour2D field)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user