Пример #1
0
		/// <summary>
		/// Forces the end of the auction and removes it from the system
		/// </summary>
		/// <param name="m">The staff member deleting the auction</param>
		/// <param name="itemfate">Specifies what should occur with the item</param>
		public void StaffDelete( Mobile m, ItemFate itemfate )
		{
			if ( AuctionSystem.Auctions.Contains( this ) )
				AuctionSystem.Auctions.Remove( this );
			else if ( AuctionSystem.Pending.Contains( this ) )
				AuctionSystem.Pending.Remove( this );

			if ( HighestBid != null )
			{
				AuctionGoldCheck gold = new AuctionGoldCheck( this, AuctionResult.StaffRemoved );
				GiveItemTo( HighestBid.Mobile, gold );
			}

			AuctionItemCheck check = new AuctionItemCheck( this, AuctionResult.StaffRemoved );
			string comments = null;

			switch( itemfate )
			{
				case ItemFate.Delete :

					check.ForceDelete();
					comments = "The item has been deleted";
					break;

				case ItemFate.ReturnToOwner:

					GiveItemTo( m_Owner, check );
					comments = "The item has been returned to the owner";
					break;

				case ItemFate.ReturnToStaff:

					GiveItemTo( m, check );
					comments = "The item has been claimed by the staff";
					break;
			}

			AuctionLog.WriteEnd( this, AuctionResult.StaffRemoved, m, comments );

			// OVer.
		}