Exemplo n.º 1
0
        public static void AddToInventory(this InventoryWriter inventory, int quantity)
        {
            var update = new Inventory.Update()
            {
                Resources = inventory.Data.Resources + quantity
            };

            inventory.SendUpdate(update);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static bool HasResources(this InventoryWriter inventory)
 {
     return(inventory.Data.Resources > 0);
 }