示例#1
0
		/// <summary>
		/// Tries to gain the specified card from the trash specified
		/// </summary>
		/// <param name="trash">The trash pile to look through</param>
		/// <param name="card">The card to gain from the trash</param>
		/// <returns>True if the card was actually gained, False otherwise</returns>
		public Boolean Gain(Trash trash, Card card)
		{
			return Gain(trash, card, DeckLocation.Discard, DeckPosition.Automatic);
		}
示例#2
0
		/// <summary>
		/// Tries to gain the specified card from the trash specified into the location and position of the deck specified
		/// </summary>
		/// <param name="trash">The trash pile to look through</param>
		/// <param name="card">The card to gain from the trash</param>
		/// <param name="location">The deck the card should go into</param>
		/// <param name="position">The position into the deck the card should go</param>
		/// <returns>True if the card was actually gained, False otherwise</returns>
		public Boolean Gain(Trash trash, Card card, DeckLocation location, DeckPosition position)
		{
			if (trash.Contains(card))
			{
				CardGainEventArgs cgea = CardGainCheckAllowed(card, location, position, false);
				if (!cgea.Cancelled)
					return this.Gain(trash.Retrieve(this, card), cgea.Location, cgea.Position, cgea.Bought);
				else
				{
					CardGainFinish(card, cgea.Location, cgea.Position, cgea.Bought, cgea.Cancelled, cgea.IsLostTrackOf);
					return true;
				}
			}
			return false;
		}
示例#3
0
		protected virtual void Dispose(bool disposing)
		{
			// Check to see if Dispose has already been called.
			if (!this.disposed)
			{
				// If disposing equals true, dispose all managed
				// and unmanaged resources.
				if (disposing)
				{
					// Dispose managed resources.
					this._Game = null;
					this._SupplyPiles = null;
					this._SpecialPiles = null;
					this._TokenPiles = null;
					this._SupplyKeys = null;
					this._Trash = null;
				}

				// Call the appropriate methods to clean up
				// unmanaged resources here.
				// If disposing is false,
				// only the following code is executed.

				// Note disposing has been done.
				disposed = true;
			}
		}