public DomainCharacter HealCharacter(long characterId, int healAmount)
        {
            DomainCharacter character = repositoryAdapter.GetCharacter(characterId);
            int             updatedHp = Math.Min(Math.Max(character.CurrentHitpoints, 0) + healAmount, character.MaxHitpoints);

            character.CurrentHitpoints = updatedHp;
            repositoryAdapter.UpdateCharacter(character);

            return(character);
        }
Esempio n. 2
0
 public ActionResult <DomainCharacter> GetDomainCharacter(int id)
 {
     return(repositoryAdapter.GetCharacter(id));
 }