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:
22
Models/ActionGathered.cs
Normal file
22
Models/ActionGathered.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PetCompanion.Models
|
||||
{
|
||||
public class ActionGathered
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("Pet")]
|
||||
public string PetId { get; set; }
|
||||
public string? Resource { get; set; }
|
||||
[ForeignKey("GameItem")]
|
||||
public int? ItemId { get; set; }
|
||||
public int Amount { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual Pet Pet { get; set; }
|
||||
public virtual GameItem? GameItem { get; set; }
|
||||
}
|
||||
}
|
@@ -27,6 +27,8 @@ namespace PetCompanion.Models
|
||||
public virtual Inventory Inventory { get; set; }
|
||||
public virtual ICollection<EquippedItem> EquippedItemsList { get; set; } = new List<EquippedItem>();
|
||||
|
||||
public virtual ICollection<ActionGathered> ActionGathered { get; set; } = new List<ActionGathered>();
|
||||
|
||||
[NotMapped]
|
||||
public Dictionary<ItemEquipTarget, int> EquippedItems
|
||||
{
|
||||
|
@@ -14,5 +14,7 @@
|
||||
GATHERING_WISDOM,
|
||||
GATHERING_GOLD,
|
||||
GATHERING_FOOD,
|
||||
EXPLORE,
|
||||
BATTLE
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user