public static void RemoveFromInventory(this InventoryWriter inventory, int quantity) { var update = new Inventory.Update() { Resources = Mathf.Max(0, inventory.Data.Resources - quantity) }; inventory.SendUpdate(update); }
public static void AddToInventory(this InventoryWriter inventory, int quantity) { var update = new Inventory.Update() { Resources = inventory.Data.Resources + quantity }; inventory.SendUpdate(update); }