public void Update(TimerEventArgs timerEventArgs)
 {
     LblTurnTime.Text         = string.Format("{0:00}:{1:00}", (timerEventArgs.Seconds / 60) % 60, timerEventArgs.Seconds % 60);
     LblPlayerTurnTime.Text   = string.Format("{0:00}:{1:00}", (timerEventArgs.PlayerSeconds / 60) % 60, timerEventArgs.PlayerSeconds % 60);
     LblOpponentTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.OpponentSeconds / 60) % 60,
                                              timerEventArgs.OpponentSeconds % 60);
 }
예제 #2
0
 private void TimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
 {
     Helper.MainWindow.Overlay.Dispatcher.BeginInvoke(
         new Action(() => Helper.MainWindow.Overlay.UpdateTurnTimer(timerEventArgs)));
     Helper.MainWindow.TimerWindow.Dispatcher.BeginInvoke(
         new Action(() => Helper.MainWindow.TimerWindow.Update(timerEventArgs)));
 }
		public void Update(TimerEventArgs timerEventArgs)
		{
			LblTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.Seconds / 60) % 60, timerEventArgs.Seconds % 60);
			LblPlayerTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.PlayerSeconds / 60) % 60, timerEventArgs.PlayerSeconds % 60);
			LblOpponentTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.OpponentSeconds / 60) % 60,
			                                         timerEventArgs.OpponentSeconds % 60);
		}
예제 #4
0
        private void TimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
        {
            Core.Overlay.Dispatcher.BeginInvoke(new Action(() => Core.Overlay.UpdateTurnTimer(timerEventArgs)));
            Core.Windows.TimerWindow.Dispatcher.BeginInvoke(new Action(() => Core.Windows.TimerWindow.Update(timerEventArgs)));

            if(CurrentActivePlayer == ActivePlayer.Player)
                CheckForTimerAlarm();
        }
예제 #5
0
        private void TimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
        {
            Helper.MainWindow.Overlay.Dispatcher.BeginInvoke(
                new Action(() => Helper.MainWindow.Overlay.UpdateTurnTimer(timerEventArgs)));
            Helper.MainWindow.TimerWindow.Dispatcher.BeginInvoke(
                new Action(() => Helper.MainWindow.TimerWindow.Update(timerEventArgs)));

            if (CurrentTurn == Turn.Player)
            {
                CheckForTimerAlarm();
            }
        }
        internal void UpdateTurnTimer(TimerEventArgs timerEventArgs)
        {
            if (timerEventArgs.Running && (timerEventArgs.PlayerSeconds > 0 || timerEventArgs.OpponentSeconds > 0))
            {
                ShowTimers();

                LblTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.Seconds / 60) % 60,
                                                 timerEventArgs.Seconds % 60);
                LblPlayerTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.PlayerSeconds / 60) % 60,
                                                       timerEventArgs.PlayerSeconds % 60);
                LblOpponentTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.OpponentSeconds / 60) % 60,
                                                         timerEventArgs.OpponentSeconds % 60);

                if (Config.Instance.Debug)
                {
                    LblDebugLog.Text += string.Format("Current turn: {0} {1} {2} \n",
                                                      timerEventArgs.CurrentTurn.ToString(),
                                                      timerEventArgs.PlayerSeconds.ToString(),
                                                      timerEventArgs.OpponentSeconds.ToString());
                    DebugViewer.ScrollToBottom();
                }
            }
        }
 internal void UpdateTurnTimer(TimerEventArgs timerEventArgs)
 {
     //todo: make moveable in option and find good size/pos
     LblTurnTime.Text       = timerEventArgs.Seconds.ToString();
     LblTurnTime.Visibility = timerEventArgs.Running ? Visibility.Visible : Visibility.Hidden;
 }
        internal void UpdateTurnTimer(TimerEventArgs timerEventArgs)
        {
            if (timerEventArgs.Running && (timerEventArgs.PlayerSeconds > 0 || timerEventArgs.OpponentSeconds > 0))
            {
                ShowTimers();

                LblTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.Seconds / 60) % 60, timerEventArgs.Seconds % 60);
                LblPlayerTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.PlayerSeconds / 60) % 60, timerEventArgs.PlayerSeconds % 60);
                LblOpponentTurnTime.Text = string.Format("{0:00}:{1:00}", (timerEventArgs.OpponentSeconds / 60) % 60,
                                                         timerEventArgs.OpponentSeconds % 60);

                if (Config.Instance.Debug)
                {
                    LblDebugLog.Text += string.Format("Current turn: {0} {1} {2} \n", timerEventArgs.CurrentActivePlayer, timerEventArgs.PlayerSeconds,
                                                      timerEventArgs.OpponentSeconds);
                    DebugViewer.ScrollToBottom();
                }
            }
        }
예제 #9
0
 private void TimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
 {
     Helper.MainWindow.Overlay.Dispatcher.BeginInvoke(
         new Action(() => Helper.MainWindow.Overlay.UpdateTurnTimer(timerEventArgs)));
     Helper.MainWindow.TimerWindow.Dispatcher.BeginInvoke(
         new Action(() => Helper.MainWindow.TimerWindow.Update(timerEventArgs)));
 }
예제 #10
0
		private void TimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
		{
			Core.Overlay.Dispatcher.BeginInvoke(new Action(() => Core.Overlay.UpdateTurnTimer(timerEventArgs)));
			Core.Windows.TimerWindow.Dispatcher.BeginInvoke(new Action(() => Core.Windows.TimerWindow.Update(timerEventArgs)));

			if(CurrentActivePlayer == ActivePlayer.Player)
				CheckForTimerAlarm();
		}
		internal void UpdateTurnTimer(TimerEventArgs timerEventArgs)
		{
			if(!timerEventArgs.Running || (timerEventArgs.PlayerSeconds <= 0 && timerEventArgs.OpponentSeconds <= 0))
				return;

			ShowTimers();
			LblTurnTime.Text = $"{(timerEventArgs.Seconds / 60) % 60:00}:{timerEventArgs.Seconds % 60:00}";
			LblPlayerTurnTime.Text = $"{(timerEventArgs.PlayerSeconds / 60) % 60:00}:{timerEventArgs.PlayerSeconds % 60:00}";
			LblOpponentTurnTime.Text = $"{(timerEventArgs.OpponentSeconds / 60) % 60:00}:{timerEventArgs.OpponentSeconds % 60:00}";
		}
		public void Update(TimerEventArgs timerEventArgs)
		{
			LblTurnTime.Text = $"{(timerEventArgs.Seconds / 60) % 60:00}:{timerEventArgs.Seconds % 60:00}";
			LblPlayerTurnTime.Text = $"{(timerEventArgs.PlayerSeconds / 60) % 60:00}:{timerEventArgs.PlayerSeconds % 60:00}";
			LblOpponentTurnTime.Text = $"{(timerEventArgs.OpponentSeconds / 60) % 60:00}:{timerEventArgs.OpponentSeconds % 60:00}";
		}
		private void TurnTimerOnTimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
		{
			_overlay.Dispatcher.BeginInvoke(new Action(() => _overlay.UpdateTurnTimer(timerEventArgs)));
			_timerWindow.Dispatcher.BeginInvoke(new Action(() => _timerWindow.Update(timerEventArgs)));

		}