Added TMP

This commit is contained in:
julius
2022-02-14 09:48:32 +01:00
parent f0a5fe201c
commit 27b7415f2e
348 changed files with 60686 additions and 139 deletions

View File

@@ -4,29 +4,37 @@ using UnityEngine;
public class Slot
{
/// <summary>
/// Holds an itemType the number of items and the number of maxItems
/// this has no logic so everything has to be done from the outside
/// [Get/Set]
/// ItemType
/// Count
/// MaxItems
/// [Methods]
/// void addItem(int count = 1)
/// void removeItem(int count = 1)
/// </summary>
Item item;
int maxItems;
int count;
public Slot(int maxItems)
{
item = null;
this.maxItems = maxItems;
count = 0;
}
public bool removeItem(int count = 1)
{
this.count -= count;
return true;
}
public bool addItem(int count = 1)
{
this.count += count;
return true;
}
int maxItems = 1;
int count = 0;
public Item ItemType { get => item; set => item = value; }
public int Count { get => count; set => count = value; }
public int MaxItems { get => maxItems; set => maxItems = value; }
public Slot(int maxItems = 1)
{
item = null;
this.maxItems = maxItems;
}
public void addItem(int count = 1)
{
// adds any number of items to the slot will also go over the max items
this.count += count;
}
public void removeItem(int count = 1)
{
// removes any number of items from the slot will also go negative
this.count -= count;
}
}