Tied inventory to robot count
This commit is contained in:
@@ -5,7 +5,7 @@ public class Inventory
|
|||||||
{
|
{
|
||||||
public List<Item> items = new List<Item>();
|
public List<Item> items = new List<Item>();
|
||||||
|
|
||||||
public int maxInventorySize = 8;
|
public int maxInventorySize = 16;
|
||||||
public event EventHandler OnInventoryUpdate;
|
public event EventHandler OnInventoryUpdate;
|
||||||
|
|
||||||
public bool AddItem(Item item, int amount)
|
public bool AddItem(Item item, int amount)
|
||||||
@@ -18,7 +18,7 @@ public class Inventory
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (items.Count < maxInventorySize)
|
if (items.Count < maxInventorySize * GameData.maxRobotCount)
|
||||||
{
|
{
|
||||||
items.Add(item);
|
items.Add(item);
|
||||||
items[items.Count - 1].currentAmount += amount;
|
items[items.Count - 1].currentAmount += amount;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public partial class InventoryDisplay : PanelContainer
|
|||||||
|
|
||||||
private void UpdateInventorySpace()
|
private void UpdateInventorySpace()
|
||||||
{
|
{
|
||||||
inventorySpace.Text = $"Used space: {GameData.inventory.items.Count}/{GameData.inventory.maxInventorySize}";
|
inventorySpace.Text = $"Used space: {GameData.inventory.items.Count}/{GameData.inventory.maxInventorySize * GameData.maxRobotCount}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReloadItems()
|
public void ReloadItems()
|
||||||
|
|||||||
Reference in New Issue
Block a user