Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FCSMoveStack Class Reference

This class stores a stack of moves.

#include <FCSMove.h>

Inheritance diagram for FCSMoveStack:

FCSCompactMoveStack FCSDebugMoveStack List of all members.

Public Member Functions

virtual ~FCSMoveStack ()
 Destructor.
void Normalize (FCSStateWithLocations *InitialState, int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks)
 Convert the moves from using the canonized positions of the stacks and freecells to a user readable position.
virtual FCSMoveStackCopy ()=0
 Make a new copy of the move stack.
virtual void Push (FCSMove *Move)=0
 Push a move onto the stack.
virtual int Pop (FCSMove **Move)=0
 Pop a move off the stack.
void Reset ()
 Clear the stack.
void SwallowStack (FCSMoveStack *SrcStack)
 Put the contents of a stack onto another.
int GetNumberOfMoves ()
 Get the number of moves on the stack.

Protected Member Functions

 FCSMoveStack ()
 Constructor.

Protected Attributes

int m_MaxNumberOfMoves
 Upper limit of the number of moves on the stack.
int m_NumberOfMoves
 Number of moves on the stack.

Detailed Description

Definition at line 137 of file FCSMove.h.


Member Function Documentation

virtual FCSMoveStack* FCSMoveStack::Copy  )  [pure virtual]
 

Returns:
A pointer to the new copy of the move stack

Implemented in FCSCompactMoveStack, and FCSDebugMoveStack.

Referenced by FCSFreecellData::TraceSolution().

int FCSMoveStack::GetNumberOfMoves  ) 
 

Returns:
The number of moves on the stack

Definition at line 258 of file FCSMove.cpp.

References m_NumberOfMoves.

Referenced by FCSFreecellData::CreateTotalMovesStack().

void FCSMoveStack::Normalize FCSStateWithLocations InitialState,
int  NumberOfFreecells,
int  NumberOfStacks,
int  NumberOfDecks
 

Parameters:
InitialState is the state to be converted
NumberOfFreecells is the number of freecells in the card game
NumberOfStacks is the number of stacks in the card game
NumberOfDecks is the number of decks in the card game

Definition at line 158 of file FCSMove.cpp.

References ApplyMove(), FCSStateWithLocations::CleanState(), FCSStateWithLocations::Copy(), FCSMove::Create(), CreateMoveStack(), CreateStateWithLocations(), FCSMove::GetDestFreecell(), FCSMove::GetDestStack(), FCSMove::GetFoundation(), FCSMove::GetNumberOfCardsFlipped(), FCSMove::GetNumberOfCardsInSequence(), FCSMove::GetSourceFreecell(), FCSMove::GetSourceStack(), FCSMove::GetType(), FCSStateWithLocations::m_FreecellLocations, FCSStateWithLocations::m_StackLocations, Pop(), Push(), Reset(), and SwallowStack().

Referenced by FCSFreecellData::ShowSolution().

virtual int FCSMoveStack::Pop FCSMove **  Move  )  [pure virtual]
 

Parameters:
Move is the move being popped off the stack
Returns:
Return 0 if no moves were on the stack

Implemented in FCSCompactMoveStack, and FCSDebugMoveStack.

Referenced by FCSFreecellData::GetNextMove(), Normalize(), and SwallowStack().

virtual void FCSMoveStack::Push FCSMove Move  )  [pure virtual]
 

Parameters:
Move is the move being pushed onto the stack

Implemented in FCSCompactMoveStack, and FCSDebugMoveStack.

Referenced by FCSFreecellSolvingAlgorithm::EmptyStackIntoFreecells(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToEmptyStack(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellData::MoveSequence(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFounds(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(), FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(), Normalize(), and SwallowStack().

void FCSMoveStack::SwallowStack FCSMoveStack SrcStack  ) 
 

Parameters:
SrcStack ist he stack being swallowed

Definition at line 248 of file FCSMove.cpp.

References FCSMove::Create(), Pop(), and Push().

Referenced by FCSFreecellData::CreateTotalMovesStack(), and Normalize().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 11:20:17 2005 for Cpp Freecell Solver by  doxygen 1.4.4