Refactor pet action management: rename PetAction to PetActionGather, update related models and services, and enhance resource gathering logic.

This commit is contained in:
2025-02-01 13:50:39 -03:00
parent e1c5eed02d
commit d6d3dc9f44
11 changed files with 350 additions and 29 deletions

View File

@@ -13,7 +13,8 @@ namespace pet_companion_api.Models
public int Level { get; set; }
public string UserId { get; set; }
public bool IsDead { get; set; }
public PetAction PetAction { get; set; }
public PetActionGather PetAction { get; set; }
public DateTime ActionSince { get; set; }
}
}

View File

@@ -1,6 +1,14 @@
namespace pet_companion_api.Models
{
public enum PetAction
{
UNKNOWN,
FEED,
PLAY,
SLEEP,
}
public enum PetActionGather
{
IDLE,
GATHERING_WISDOM,

View File

@@ -5,8 +5,25 @@ namespace pet_companion_api.Models
{
public string Name { get; set; }
public string Description { get; set; }
public string[] Modifiers { get; set; }
public List<Modifier> Modifiers { get; set; }
public string Color { get; set; }
public string Emoji { get; set; }
public PetClass Class { get; set; }
}
public class Modifier
{
public string Description { get; set; }
/// <summary>
/// Other property (unused atm)
/// </summary>
public string? Misc { get; set; }
/// <summary>
/// Either `intelligence`, `strength` or `charisma`
/// </summary>
public string? Attribute { get; set; } // The attribute that the modifier affects (used by reflection)
public float? Value { get; set; }
}
}

View File

@@ -2,6 +2,7 @@ namespace pet_companion_api.Models
{
public class PetUpdateActionRequest
{
public PetAction PetAction { get; set; }
public PetAction? Action { get; set; }
public PetActionGather? PetActionGather { get; set; }
}
}