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

FCSCompactStateWithLocations< StateWithLocation > Class Template Reference

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

#include <FCSCompactStateWithLocations.h>

Inheritance diagram for FCSCompactStateWithLocations< StateWithLocation >:

FCSCompactTalonStateWithLocations List of all members.

Public Member Functions

 FCSCompactStateWithLocations ()
 Constructor.
virtual ~FCSCompactStateWithLocations ()
 Destructor.
virtual void Copy (FCSStateWithLocations *State)
 Copy FCSCompactStateWithLocations object.
int Compare (const FCSStateWithLocations *State)
 Compare a FCSCompactStateWithLocations 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 CanonizeState (int NumberOfFreecells, int NumberOfStacks)
 Canonize the state - put it into the internal representation.
FCSStateGetState ()
 Get a pointer to the compact state.

Protected Attributes

FCSCompactState m_State
 State in compact form.

Detailed Description

template<class StateWithLocation>
class FCSCompactStateWithLocations< StateWithLocation >

Definition at line 44 of file FCSCompactStateWithLocations.h.


Member Function Documentation

template<class StateWithLocation>
void FCSCompactStateWithLocations< 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 307 of file FCSCompactStateWithLocations.h.

References FCSCard::Compare(), FCS_FREECELLS_OFFSET, FCSCompactState::m_Data, FCSCompactStateWithLocations< StateWithLocation >::m_State, and FCSCompactState::StackCompare().

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

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

Definition at line 199 of file FCSCompactStateWithLocations.h.

References FCSCompactState::Compare(), and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

Parameters:
State is the FCSCompactStateWithLocations to be copied

Reimplemented in FCSCompactTalonStateWithLocations.

Definition at line 191 of file FCSCompactStateWithLocations.h.

References FCSCompactStateWithLocations< StateWithLocation >::m_State.

Referenced by FCSCompactTalonStateWithLocations::Copy().

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

Parameters:
Freecell to be cleared

Definition at line 295 of file FCSCompactStateWithLocations.h.

References FCS_FREECELLS_OFFSET, FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

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

Definition at line 301 of file FCSCompactStateWithLocations.h.

References FCSCompactState::m_Data, FCSCompactStateWithLocations< StateWithLocation >::m_State, and FCSCompactCard::SetFlipped().

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

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

Definition at line 247 of file FCSCompactStateWithLocations.h.

References FCS_FOUNDATIONS_OFFSET, FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

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

Definition at line 229 of file FCSCompactStateWithLocations.h.

References FCS_FREECELLS_OFFSET, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

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

Definition at line 241 of file FCSCompactStateWithLocations.h.

References FCS_FREECELLS_OFFSET, FCSCompactCard::GetCardNumber(), FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

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

Definition at line 235 of file FCSCompactStateWithLocations.h.

References FCS_FREECELLS_OFFSET, FCSCompactCard::GetSuit(), FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
FCSCard * FCSCompactStateWithLocations< 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 205 of file FCSCompactStateWithLocations.h.

References FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

template<class StateWithLocation>
char FCSCompactStateWithLocations< 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 217 of file FCSCompactStateWithLocations.h.

References FCSCompactCard::GetCardNumber(), FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
char FCSCompactStateWithLocations< 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 211 of file FCSCompactStateWithLocations.h.

References FCSCompactCard::GetSuit(), FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
int FCSCompactStateWithLocations< 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 223 of file FCSCompactStateWithLocations.h.

References FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

Referenced by FCSCompactStateWithLocations< StateWithLocation >::PopStackCard(), and FCSCompactStateWithLocations< StateWithLocation >::PushCardIntoStack().

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

Returns:
A pointer to the compact state at this location

Definition at line 360 of file FCSCompactStateWithLocations.h.

References FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

Parameters:
Foundation the card is in

Definition at line 253 of file FCSCompactStateWithLocations.h.

References FCS_FOUNDATIONS_OFFSET, FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

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

Definition at line 265 of file FCSCompactStateWithLocations.h.

References FCSCard::Copy(), FCSCompactCard::EmptyCard(), FCSCompactStateWithLocations< StateWithLocation >::GetStackCard(), FCSCompactStateWithLocations< StateWithLocation >::GetStackLength(), FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

template<class StateWithLocation>
void FCSCompactStateWithLocations< 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 282 of file FCSCompactStateWithLocations.h.

References FCSCompactCard::Copy(), FCSCompactStateWithLocations< StateWithLocation >::GetStackLength(), FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

template<class StateWithLocation>
void FCSCompactStateWithLocations< 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 275 of file FCSCompactStateWithLocations.h.

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

template<class StateWithLocation>
void FCSCompactStateWithLocations< 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 289 of file FCSCompactStateWithLocations.h.

References FCSCompactCard::Copy(), FCS_FREECELLS_OFFSET, FCSCompactState::m_Data, and FCSCompactStateWithLocations< StateWithLocation >::m_State.

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

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

Definition at line 259 of file FCSCompactStateWithLocations.h.

References FCS_FOUNDATIONS_OFFSET, FCSCompactCard::m_Card, FCSCompactState::m_Data, and FCSCompactStateWithLocations< 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