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

FCSIndirectStateWithLocations< StateWithLocation > Class Template Reference

Abstract class representing a indirect state in a card game with additional data to process and store it.

#include <FCSIndirectStateWithLocations.h>

List of all members.

Public Member Functions

 FCSIndirectStateWithLocations ()
 Constructor.
virtual ~FCSIndirectStateWithLocations ()
 Destructor.
virtual void Copy (FCSStateWithLocations *State)
 Copy FCSIndirectStateWithLocations object.
int Compare (const FCSStateWithLocations *State)
 Compare a FCSIndirectStateWithLocations to another.
FCSCardGetStackCard (int Stack, int Card)
 Get a card from the state.
char GetStackCardSuit (int Stack, int Card)
 Get a suit from a card in the state.
char GetStackCardNumber (int Stack, int Card)
 Get a card number from a card in the state.
int GetStackLength (int Stack)
 Get the number of cards in the stack.
FCSCardGetFreecellCard (int Freecell)
 Get a freecell card from the state.
char GetFreecellCardSuit (int Freecell)
 Get a suit from a freecell card in the state.
char GetFreecellCardNumber (int Freecell)
 Get a card number from a freecell card in the state.
char GetFoundation (int Foundation)
 Get a card number from a foundation in the state.
void IncrementFoundation (int Foundation)
 Add the next card to a foundation in the state.
void SetFoundation (int Foundation, char Value)
 Put a card into a foundation in the state.
void PopStackCard (int Stack, FCSCard *Card)
 Take a card off a stack in the state.
void PushStackCardIntoStack (int DestStack, int SrcStack, int SrcCard)
 Move a card from one stack to another.
void PushCardIntoStack (int DestStack, FCSCard *Card)
 Move a card onto a stack.
void PutCardInFreecell (int Freecell, FCSCard *Card)
 Move a card onto a freecll.
void EmptyFreecell (int Freecell)
 Clear a freecell.
void FlipStackCard (int Stack, int Card)
 Make a stack card flipped over (visible).
void Initialize (int NumberOfStacks)
 Initialize the state and stacks.
void CleanState ()
 Clear the stacks of the state.
void CacheStacks (AFCSGenericStackStorage *Storage, int StackNumber)
 Cache the stacks of the state.
void CanonizeState (int NumberOfFreecells, int NumberOfStacks)
 Canonize the state - put it into the internal representation.
FCSStateGetState ()
 Get a pointer to the indirect state.

Public Attributes

FCSIndirectState m_State
 State in compact form.


Detailed Description

template<class StateWithLocation>
class FCSIndirectStateWithLocations< StateWithLocation >

Definition at line 21 of file FCSIndirectStateWithLocations.h.


Member Function Documentation

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::CacheStacks AFCSGenericStackStorage Storage,
int  StackNumber
 

Parameters:
Storage is the storage mechanism for caching the stacks
StackNumber is the stack being cached

Definition at line 324 of file FCSIndirectStateWithLocations.h.

References FCSIndirectStateWithLocations< StateWithLocation >::GetStackLength(), AFCSGenericStackStorage::Insert(), FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::CanonizeState int  NumberOfFreecells,
int  NumberOfStacks
 

Parameters:
NumberOfFreecells is the number of freecells in the card game
NumberOfStacks is the number of stacks in the card game

Definition at line 342 of file FCSIndirectStateWithLocations.h.

References FCSCard::Compare(), FCSIndirectCard::m_Card, FCSIndirectState::m_Freecells, FCSIndirectState::m_Stacks, FCSIndirectStateWithLocations< StateWithLocation >::m_State, FCSIndirectState::StackCompare(), and FCSIndirectState::StackSortCompare().

template<class StateWithLocation>
int FCSIndirectStateWithLocations< StateWithLocation >::Compare const FCSStateWithLocations State  ) 
 

Parameters:
State to be compared to
Returns:
-1 if this FCSIndirectStateWithLocations < State, 1 if FCSIndirectStateWithLocations > State, 0 if FCSIndirectStateWithLocations = State

Definition at line 200 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::Compare(), and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::Copy FCSStateWithLocations State  )  [virtual]
 

Parameters:
State is the FCSIndirectStateWithLocations to be copied

Reimplemented in FCSIndirectTalonStateWithLocations.

Definition at line 179 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::Copy(), FCSIndirectStateWithLocations< StateWithLocation >::GetStackLength(), FCSIndirectCard::m_Card, FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

Referenced by FCSIndirectTalonStateWithLocations::Copy().

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::EmptyFreecell int  Freecell  ) 
 

Parameters:
Freecell to be cleared

Definition at line 296 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::m_Card, FCSIndirectState::m_Freecells, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::FlipStackCard int  Stack,
int  Card
 

Parameters:
Stack the card is in
Card is the position of the card

Definition at line 302 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::m_Stacks, FCSIndirectStateWithLocations< StateWithLocation >::m_State, and FCSIndirectCard::SetFlipped().

template<class StateWithLocation>
char FCSIndirectStateWithLocations< StateWithLocation >::GetFoundation int  Foundation  ) 
 

Parameters:
Foundation the card is in
Returns:
The card's number

Definition at line 248 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::m_Foundations, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
FCSCard * FCSIndirectStateWithLocations< StateWithLocation >::GetFreecellCard int  Freecell  ) 
 

Parameters:
Freecell the card is in
Returns:
A pointer to the card

Definition at line 230 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::m_Freecells, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
char FCSIndirectStateWithLocations< StateWithLocation >::GetFreecellCardNumber int  Freecell  ) 
 

Parameters:
Freecell the card is in
Returns:
The card's number

Definition at line 242 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::GetCardNumber(), FCSIndirectState::m_Freecells, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
char FCSIndirectStateWithLocations< StateWithLocation >::GetFreecellCardSuit int  Freecell  ) 
 

Parameters:
Freecell the card is in
Returns:
The card's suit

Definition at line 236 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::GetSuit(), FCSIndirectState::m_Freecells, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
FCSCard * FCSIndirectStateWithLocations< StateWithLocation >::GetStackCard int  Stack,
int  Card
 

Parameters:
Stack the card is in
Card is the position of the card
Returns:
A pointer to the card

Definition at line 206 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

Referenced by FCSIndirectStateWithLocations< StateWithLocation >::PopStackCard(), and FCSIndirectStateWithLocations< StateWithLocation >::PushStackCardIntoStack().

template<class StateWithLocation>
char FCSIndirectStateWithLocations< StateWithLocation >::GetStackCardNumber int  Stack,
int  Card
 

Parameters:
Stack the card is in
Card is the position of the card
Returns:
The card's number

Definition at line 218 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::GetCardNumber(), FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
char FCSIndirectStateWithLocations< StateWithLocation >::GetStackCardSuit int  Stack,
int  Card
 

Parameters:
Stack the card is in
Card is the position of the card
Returns:
The card's suit

Definition at line 212 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::GetSuit(), FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
int FCSIndirectStateWithLocations< StateWithLocation >::GetStackLength int  Stack  ) 
 

Parameters:
Stack is the stack to get the length from
Returns:
The number of cards in the stack

Definition at line 224 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::m_Card, FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

Referenced by FCSIndirectStateWithLocations< StateWithLocation >::CacheStacks(), FCSIndirectStateWithLocations< StateWithLocation >::Copy(), FCSIndirectStateWithLocations< StateWithLocation >::PopStackCard(), and FCSIndirectStateWithLocations< StateWithLocation >::PushCardIntoStack().

template<class StateWithLocation>
FCSState * FCSIndirectStateWithLocations< StateWithLocation >::GetState  ) 
 

Returns:
A pointer to the indirect state at this location

Definition at line 401 of file FCSIndirectStateWithLocations.h.

References FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::IncrementFoundation int  Foundation  ) 
 

Parameters:
Foundation the card is in

Definition at line 254 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::m_Foundations, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::PopStackCard int  Stack,
FCSCard Card
 

Parameters:
Stack the card is in
Card a pointer to the card being removed

Definition at line 266 of file FCSIndirectStateWithLocations.h.

References FCSCard::Copy(), FCSIndirectCard::EmptyCard(), FCSIndirectStateWithLocations< StateWithLocation >::GetStackCard(), FCSIndirectStateWithLocations< StateWithLocation >::GetStackLength(), FCSIndirectCard::m_Card, FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::PushCardIntoStack int  DestStack,
FCSCard Card
 

Parameters:
DestStack is the stack the card is going to
Card a pointer to the card being added

Definition at line 283 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::Copy(), FCSIndirectStateWithLocations< StateWithLocation >::GetStackLength(), FCSIndirectCard::m_Card, FCSIndirectState::m_Stacks, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

Referenced by FCSIndirectStateWithLocations< StateWithLocation >::PushStackCardIntoStack().

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::PushStackCardIntoStack int  DestStack,
int  SrcStack,
int  SrcCard
 

Parameters:
DestStack is the stack the card is going to
SrcStack is the stack the card is coming from
SrcCard is the position of the card in the source stack

Definition at line 276 of file FCSIndirectStateWithLocations.h.

References FCSIndirectStateWithLocations< StateWithLocation >::GetStackCard(), and FCSIndirectStateWithLocations< StateWithLocation >::PushCardIntoStack().

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::PutCardInFreecell int  Freecell,
FCSCard Card
 

Parameters:
Freecell the card is going to be put in
Card a pointer to the card being added

Definition at line 290 of file FCSIndirectStateWithLocations.h.

References FCSIndirectCard::Copy(), FCSIndirectState::m_Freecells, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSIndirectStateWithLocations< StateWithLocation >::SetFoundation int  Foundation,
char  Value
 

Parameters:
Foundation the card is in
Value is the card number

Definition at line 260 of file FCSIndirectStateWithLocations.h.

References FCSIndirectState::m_Foundations, and FCSIndirectStateWithLocations< StateWithLocation >::m_State.


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