Add action gathering functionality: implement ActionGathered model and repository, update Pet model and services, and enhance GameItemsRepository with item retrieval methods.
This commit is contained in:
@@ -146,6 +146,12 @@ namespace PetCompanion.Services
|
||||
if (gameItem == null)
|
||||
throw new Exception("Item not found");
|
||||
|
||||
if (pet == null)
|
||||
throw new Exception("Pet not found");
|
||||
|
||||
if (pet.Inventory.Items.Count + quantity > pet.Inventory.Capacity)
|
||||
throw new Exception("Not enough space in inventory");
|
||||
|
||||
for (int i = 0; i < quantity; i++)
|
||||
{
|
||||
pet.Inventory.Items.Add(itemId);
|
||||
|
||||
Reference in New Issue
Block a user