Spawning and watering is now bound to the cursor position (kinda)

This commit is contained in:
2025-04-25 00:13:50 +02:00
parent 339428c312
commit 762a694be3
4 changed files with 26 additions and 28 deletions
@@ -15,7 +15,6 @@ public partial class FieldService : Node3D
if (!fields.ContainsKey(key))
{
fields.Add(key, field);
Debug.Print("Added entry: " + key);
return true;
}
return false;
@@ -24,12 +23,8 @@ public partial class FieldService : Node3D
// Read
public FieldBehaviour Get(Vector2I key)
{
Debug.Print($"Getting field at {key}. Found: {fields.ContainsKey(key)}.");
if (fields.TryGetValue(key, out FieldBehaviour field))
{
Debug.Print($"Getting field at {key}, field: {field.Name}.");
return field;
}
return null;
}
@@ -38,7 +33,6 @@ public partial class FieldService : Node3D
public void UpdateEntry(Vector2I fieldPosition, FieldBehaviour state)
{
Debug.Print("Updating entry: " + fieldPosition);
if (fields.ContainsKey(fieldPosition))
{
fields[fieldPosition] = state;
@@ -53,7 +47,6 @@ public partial class FieldService : Node3D
public void RemoveEntry(Vector2I fieldPosition)
{
Debug.Print("Removing entry: " + fieldPosition);
if (fields.ContainsKey(fieldPosition))
{
fields.Remove(fieldPosition);