Esempio n. 1
0
        internal void OnShuffled()
        {
            // Remove player looking at the cards, if any (doesn't remove the need to remove those from the dictionary!)
            foreach (List <Card> list in LookedAt.Values)
            {
                list.Clear();
            }
            foreach (Card c in Cards)
            {
                c.PlayersLooking.Clear();
                c.PeekingPlayers.Clear();
            }

            // Notify trace event listeners
            var shuffledArgs = new ShuffleTraceEventArgs {
                TraceNotification = true
            };

            if (ShuffledTrace != null)
            {
                ShuffledTrace(this, shuffledArgs);
            }
            // Trace if required
            if (shuffledArgs.TraceNotification)
            {
                Program.GameMess.PlayerEvent(Owner, "shuffled {0}", FullName);
            }
            OnCardsChanged();
        }
Esempio n. 2
0
        internal void OnShuffled()
        {
            // Remove player looking at the cards, if any (doesn't remove the need to remove those from the dictionary!)
            foreach (List <Card> list in LookedAt.Values)
            {
                list.Clear();
            }
            foreach (Card c in Cards)
            {
                c.PlayersLooking.Clear();
            }

            // Notify trace event listeners
            var shuffledArgs = new ShuffleTraceEventArgs {
                TraceNotification = true
            };

            if (ShuffledTrace != null)
            {
                ShuffledTrace(this, shuffledArgs);
            }
            // Trace if required
            if (shuffledArgs.TraceNotification)
            {
                Program.TracePlayerEvent(Owner, "{0} is shuffled", FullName);
            }

            WantToShuffle = Locked = false;

            // Notify completion (e.g. to resume scripts execution)
            if (Shuffled != null)
            {
                Shuffled(this, EventArgs.Empty);
            }
        }
Esempio n. 3
0
        public void ReplaceText(object sender, ShuffleTraceEventArgs e)
        {
            e.TraceNotification = false;
            var group = (Group)sender;

            group.ShuffledTrace -= ReplaceText;
            var run = (Run)Line;

            run.Text = string.Format("{0} is shuffled", group.FullName);
        }