www.pudn.com > sudoku.rar > PuzzleStateStack.cs


//-------------------------------------------------------------------------- 
//  
//  Copyright (c) Microsoft Corporation.  All rights reserved.  
//  
//  File: PuzzleStateStack.cs 
// 
//  Description: A Stack of PuzzleState objects. 
//  
//-------------------------------------------------------------------------- 
 
using System; 
using System.Text; 
using System.Collections; 
 
namespace Microsoft.Sudoku.Collections 
{ 
	/// A stack of PuzzleState instances. 
	[Serializable] 
	internal sealed class PuzzleStateStack : Stack 
	{ 
		/// Inserts an object at the top of the stack. 
		/// The object to push onto the stack. 
		public void Push(PuzzleState obj) 
		{ 
			base.Push(obj); 
		} 
 
		/// Inserts an object at the top of the stack. 
		/// The object to push onto the stack. 
		public override void Push(object obj) 
		{ 
			if (!(obj is PuzzleState)) throw new ArgumentOutOfRangeException("obj"); 
			base.Push(obj); 
		} 
 
		/// Removes and returns the object at the top of the stack 
		/// The object removed from the top of the stack 
		public new PuzzleState Pop() 
		{ 
			return (PuzzleState)base.Pop(); 
		} 
	} 
}