Example #1
0
		internal void ShuffleDrawPile()
		{
			if (Shuffling != null)
			{
				ShuffleEventArgs sea = new ShuffleEventArgs(this);
				Shuffling(this, sea);
			}
			_DrawPile.Shuffle();
			if (Shuffled != null)
			{
				ShuffleEventArgs sea = new ShuffleEventArgs(this);
				Shuffled(this, sea);
			}
		}
		void player_Shuffled(object sender, ShuffleEventArgs e)
		{
			// Only do this if we're the first one
			if (e.HandledBy.Contains(this.CardType))
				return;

			CardCollection deck = e.Player.DrawPile.Retrieve(e.Player, c => true);

			Choice choiceShuffle = new Choice("Cards have been shuffled.  You may rearrange them", this, deck, Visibility.None, e.Player, true, deck.Count, deck.Count);
			ChoiceResult resultShuffle = e.Player.MakeChoice(choiceShuffle);

			e.Player.DrawPile.AddRange(e.Player, resultShuffle.Cards);

			e.HandledBy.Add(this.CardType);
		}