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:
@@ -35,6 +35,14 @@ namespace PetCompanion.Services
|
||||
}
|
||||
}
|
||||
|
||||
public GameItem GetRandomItem()
|
||||
{
|
||||
var items = gameItemsRepository.GetAll();
|
||||
var random = new Random();
|
||||
var index = random.Next(items.Count());
|
||||
return items.ElementAt(index);
|
||||
}
|
||||
|
||||
public void ApplyItemEffect(Pet pet, GameItem item)
|
||||
{
|
||||
var effects = item.Effect.Split(';');
|
||||
|
||||
Reference in New Issue
Block a user