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); }
public ActionResult <DomainCharacter> GetDomainCharacter(int id) { return(repositoryAdapter.GetCharacter(id)); }