Refactor namespaces to follow new naming convention and add item model classes

This commit is contained in:
2025-02-02 12:39:59 -03:00
parent 4e5addd1d5
commit 0a257199f7
27 changed files with 463 additions and 94 deletions

28
Models/Inventory.cs Normal file
View File

@@ -0,0 +1,28 @@
namespace Pet.Companion.Models
{
public class Inventory
{
public List<Item> Items { get; set; } = new();
public int Capacity { get; set; }
public bool AddItem(Item item)
{
if (Items.Count < Capacity)
{
Items.Add(item);
return true;
}
return false;
}
public bool RemoveItem(Item item)
{
return Items.Remove(item);
}
public void TrashItem(Item item)
{
RemoveItem(item);
}
}
}