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);
        }
Exemplo n.º 2
0
 public ActionResult <DomainCharacter> UpdateDomainCharacter(DomainCharacter characterToUpdate, long id)
 {
     characterToUpdate.Id = id;
     return(repositoryAdapter.UpdateCharacter(characterToUpdate));
 }