コード例 #1
0
 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)));
 }
コード例 #3
0
		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();
            }
        }
コード例 #6
0
        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();
                }
            }
        }
コード例 #7
0
 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;
 }
コード例 #8
0
        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();
		}
コード例 #11
0
		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}";
		}
コード例 #12
0
		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}";
		}
コード例 #13
0
		private void TurnTimerOnTimerTick(TurnTimer sender, TimerEventArgs timerEventArgs)
		{
			_overlay.Dispatcher.BeginInvoke(new Action(() => _overlay.UpdateTurnTimer(timerEventArgs)));
			_timerWindow.Dispatcher.BeginInvoke(new Action(() => _timerWindow.Update(timerEventArgs)));

		}