Beispiel #1
0
        public Task OnNotificationReceived(PlayerDamageLevel damageLevel)
        {
            switch (damageLevel)
            {
            case PlayerDamageLevel.None:
                _activeDamageSprite = null;
                break;

            case PlayerDamageLevel.Light:
                _activeDamageSprite = _lightDamageSprite;
                break;

            case PlayerDamageLevel.Medium:
                _activeDamageSprite = _mediumDamageSprite;
                break;

            case PlayerDamageLevel.Heavy:
                _activeDamageSprite = _heavyDamageSprite;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(damageLevel), damageLevel, null);
            }

            return(Task.CompletedTask);
        }
Beispiel #2
0
 public async Task PublishPlayerDamageLevel(PlayerDamageLevel damageLevel)
 {
     await _playerDamageLevelUpdateChannel.PublishNotification(damageLevel).ConfigureAwait(false);
 }