Refactor pet action management: rename PetAction to PetBasicAction, update related properties and methods, and enhance pet stats with maximum values.

This commit is contained in:
2025-02-01 23:08:25 -03:00
parent d6d3dc9f44
commit df62710b9a
14 changed files with 173 additions and 239 deletions
+23 -2
View File
@@ -14,7 +14,28 @@ namespace pet_companion_api.Models
public string UserId { get; set; }
public bool IsDead { get; set; }
public PetActionGather PetAction { get; set; }
public DateTime ActionSince { get; set; }
public PetActionGather PetGatherAction { get; set; }
public DateTime GatherActionSince { get; set; }
public PetBasicAction PetBasicAction { get; set; }
public DateTime BasicActionCooldown { get; set; }
public void IncrementIntelligence(int amount)
{
var newValue = Stats.Intelligence + amount;
Stats.Intelligence = Math.Min(newValue, Stats.MaxIntelligence);
}
public void IncrementStrength(int amount)
{
var newValue = Stats.Strength + amount;
Stats.Strength = Math.Min(newValue, Stats.MaxStrength);
}
public void IncrementCharisma(int amount)
{
var newValue = Stats.Charisma + amount;
Stats.Charisma = Math.Min(newValue, Stats.MaxCharisma);
}
}
}