Beispiel #1
0
        private void umgebung_Verantwortungswechsel(object sender, AreaChangeEventArgs e)
        {
            // Aktuellen Timer stoppen
            if (currentPlayer != e.Player && currentPlayer != null)
            {
                playerWatch.Stop();
                // TODO: need another key
                if (!playerTimes.ContainsKey(currentPlayer.Guid))
                {
                    playerTimes.Add(currentPlayer.Guid, 0);
                }
                playerTimes[currentPlayer.Guid] += playerWatch.ElapsedTicks;
                currentPlayer = null;
                currentArea   = Area.Unknown;
            }

            // Neuen Timer starten
            if (e.Player != null)
            {
                currentPlayer = e.Player;
                currentArea   = e.Area;
                playerWatch.Reset();
                playerWatch.Start();
            }
        }
Beispiel #2
0
 /// <summary>
 /// Weitergabe des Verantwortungswechsels
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void playerCallAreaChanged(object sender, AreaChangeEventArgs e)
 {
     AreaChange(this, e);
 }