Basic watering functionality implemented
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user