private void onTimeRemainingUpdated()
        {
            var data = new TimeRemainingEventArgs {
                TimeRemaining = this.timeRemaining
            };

            this.TimeRemainingUpdated?.Invoke(this, data);
        }
示例#2
0
        private void resetTimeRemainingTimer()
        {
            this.timeRemainingTimer.Stop();
            this.playerManager.ResetTimeRemaining();

            var timeRemaining = new TimeRemainingEventArgs {
                TimeRemaining = this.playerManager.TimeRemaining
            };

            this.TimeRemainingCount?.Invoke(this, timeRemaining);

            this.timeRemainingTimer.Start();
        }
示例#3
0
        private void timeRemainingTimerOnTick(object sender, object e)
        {
            this.playerManager.DecrementTimeRemaining();

            var timeRemaining = new TimeRemainingEventArgs {
                TimeRemaining = this.playerManager.TimeRemaining
            };

            this.TimeRemainingCount?.Invoke(this, timeRemaining);

            if (this.playerManager.TimeRemaining == 0)
            {
                this.handleTimeRemainingIsZero();
            }
        }
示例#4
0
        private async void handlePowerUpIsHit(PowerUp powerUp)
        {
            this.PowerUpActivated?.Invoke(this, EventArgs.Empty);
            if (powerUp.PowerUpType == PowerUpType.Timer)
            {
                this.playerManager.TimerPowerUp();
                powerUp.Sprite.Visibility = Visibility.Collapsed;
                var timeRemaining = new TimeRemainingEventArgs {
                    TimeRemaining = this.playerManager.TimeRemaining
                };
                this.TimeRemainingCount?.Invoke(this, timeRemaining);
            }
            else
            {
                this.playerIsImmune       = true;
                powerUp.Sprite.Visibility = Visibility.Collapsed;
                await Task.Delay(3000);

                this.playerIsImmune = false;
            }
        }