Update Broker
This commit is contained in:
@@ -25,6 +25,27 @@ namespace PlantBox.Broker
|
||||
|
||||
public PlantBox GetPlantBox(ulong id) => this[id];
|
||||
|
||||
public void Add(PlantBox plantBox)
|
||||
{
|
||||
ulong id = plantBox.ID;
|
||||
if (_plantBoxes.ContainsKey(id))
|
||||
{
|
||||
_plantBoxes[id] = plantBox;
|
||||
}
|
||||
else
|
||||
{
|
||||
_plantBoxes.Add(id, plantBox);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePlantsState()
|
||||
{
|
||||
foreach (PlantBox plantBox in _plantBoxes.Values)
|
||||
{
|
||||
plantBox.UpdateState();
|
||||
}
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
Console.WriteLine("Loading storage...");
|
||||
|
||||
Reference in New Issue
Block a user