示例#1
0
        public override void Handle(BattleEnded @event)
        {
            var battle = _battleRepository.Find(@event.BattleId);
            var result = battle.GetEndResult();

            foreach (var playerResult in result.Players)
            {
                var player = _playerRepository.Find(playerResult.PlayerId);

                player.UpdateHp(playerResult.Hp);

                _playerRepository.Save(player);
            }
        }