Basic watering functionality implemented

This commit is contained in:
2025-04-24 23:36:23 +02:00
parent 7e19268847
commit 339428c312
11 changed files with 91 additions and 69 deletions
@@ -15,9 +15,9 @@ public partial class FieldService : Node3D
if (!fields.ContainsKey(key))
{
fields.Add(key, field);
Debug.Print("Added entry: " + key);
return true;
}
Debug.Print("Added entry: " + key);
return false;
}
@@ -25,8 +25,12 @@ public partial class FieldService : Node3D
public FieldBehaviour Get(Vector2I key)
{
Debug.Print($"Getting field at {key}. Found: {fields.ContainsKey(key)}.");
if(fields.TryGetValue(key, out FieldBehaviour field))
if (fields.TryGetValue(key, out FieldBehaviour field))
{
Debug.Print($"Getting field at {key}, field: {field.Name}.");
return field;
}
return null;
}