Ejemplo n.º 1
0
        public async Task <DamageRpgCharacterResponse> Handle(DamageRpgCharacterRequest request, CancellationToken cancellationToken)
        {
            var character = await repository.GetById(request.CharacterId);

            character.Damage(request.Damage);
            await repository.Save(character);

            return(new DamageRpgCharacterResponse());
        }
Ejemplo n.º 2
0
        public async Task <HealRpgCharacterResponse> Handle(HealRpgCharacterRequest request, CancellationToken cancellationToken)
        {
            var character = await repository.GetById(request.CharacterId);

            character.Heal(request.Heal);
            await repository.Save(character);

            return(new HealRpgCharacterResponse());
        }
Ejemplo n.º 3
0
 public async Task <GetRpgCharacterResponse> Handle(GetRpgCharacterRequest request, CancellationToken cancellationToken)
 => new GetRpgCharacterResponse(await repository.GetById(request.Id));