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

FCSTalonStateWithLocations Class Reference

Data representation of a state with locations for a card game with talons.

#include <FCTalonState.h>

Inheritance diagram for FCSTalonStateWithLocations:

FCSStateWithLocations FCSCompactStateWithLocations< FCSTalonStateWithLocations > FCSDebugStateWithLocations< FCSTalonStateWithLocations > FCSIndirectStateWithLocations< FCSTalonStateWithLocations > FCSIndirectTalonStateWithLocations List of all members.

Public Member Functions

 FCSTalonStateWithLocations ()
 Constructor.
virtual ~FCSTalonStateWithLocations ()
 Destructor.
virtual int CheckStateValidity (int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks, FCSCard **MisplacedCard, FCSTalonType TalonType)
 Validiate that this state is valid.
virtual void StateAsString (char *String, FCSDebugDisplayInfo *DebugInfo)
 Represent a FCSTalonStateWithLocations object as a string.
virtual FCSCardGetTalon (int Position)
 Get a talon card.
virtual void CacheTalonStacks (FCInternalHash< FCSTalonStateData, void > *TalonHash)=0
 Cache the talon cards stack.
virtual void CreateTalons (int NumberOfTalons)=0
 Create a number of talon cards.
virtual FCSTalonStateDataGetTalonData ()=0
 Get a pointer to all the talon data.
virtual void DecrementKlondikeTalonStack ()=0
 Take a card off of the talon stack.

Static Public Member Functions

static FCSStateWithLocationsCreateInitialState (const char *String, int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks, FCSTalonType TalonType)
 Convert a string representation of a state into a FCSTalonStateWithLocations object.

Detailed Description

Definition at line 161 of file FCTalonState.h.


Member Function Documentation

virtual void FCSTalonStateWithLocations::CacheTalonStacks FCInternalHash< FCSTalonStateData, void > *  TalonHash  )  [pure virtual]
 

Parameters:
TalonHash is the hash table holding the stacks of talon cards

Implemented in FCSIndirectTalonStateWithLocations.

int FCSTalonStateWithLocations::CheckStateValidity int  NumberOfFreecells,
int  NumberOfStacks,
int  NumberOfDecks,
FCSCard **  MisplacedCard,
FCSTalonType  TalonType
[virtual]
 

Parameters:
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
MisplacedCard will contain a misplaced card if there is one
TalonType is the talon type of the game
Returns:
Returns 0 if state is valid, non-zero if state is invalid

Reimplemented from FCSStateWithLocations.

Definition at line 440 of file FCTalonState.cpp.

References FCSCard::Create(), FCSCard::GetCardNumber(), FCSStateWithLocations::GetFoundation(), FCSStateWithLocations::GetFreecellCardNumber(), FCSStateWithLocations::GetFreecellCardSuit(), FCSTalonStateData::GetKlondikeTalonLength(), FCSStateWithLocations::GetStackCardNumber(), FCSStateWithLocations::GetStackCardSuit(), FCSStateWithLocations::GetStackLength(), FCSCard::GetSuit(), GetTalon(), GetTalonData(), FCSTalonStateData::GetTalonLength(), and FCSTalonStateData::GetTalonPosition().

FCSStateWithLocations * FCSTalonStateWithLocations::CreateInitialState const char *  String,
int  NumberOfFreecells,
int  NumberOfStacks,
int  NumberOfDecks,
FCSTalonType  TalonType
[static]
 

Parameters:
String is the string 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
TalonType is the talon type of the game
Returns:
A pointer to the newly created FCSTalonStateWithLocations object

Definition at line 155 of file FCTalonState.cpp.

References FCSCard::Copy(), FCSCard::Create(), CreateStateWithLocations(), CreateTalons(), FCSCard::EmptyCard(), FCSStateWithLocations::EmptyFreecell(), FoundationsPrefixes, FreecellsPrefixes, GetTalon(), GetTalonData(), FCSTalonStateData::GetTalonLength(), FCSStateWithLocations::Initialize(), NumberOfRedealsPrefixes, FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PutCardInFreecell(), FCSStateWithLocations::SetFoundation(), FCSTalonStateData::SetKlondikeNumberOfRedealsLeft(), FCSTalonStateData::SetKlondikeTalonLength(), FCSTalonStateData::SetKlondikeTalonQueuePosition(), FCSTalonStateData::SetKlondikeTalonStackPosition(), FCSTalonStateData::SetTalonLength(), FCSTalonStateData::SetTalonPosition(), TalonPrefixes, FCSCard::User2Perl(), FCSCard::User2PerlCardNumber(), and FCSCard::User2PerlSuit().

Referenced by CreateInitialState().

virtual void FCSTalonStateWithLocations::CreateTalons int  NumberOfTalons  )  [pure virtual]
 

Parameters:
NumberOfTalons is the number of talon cards to create

Implemented in FCSIndirectTalonStateWithLocations.

Referenced by CreateInitialState().

FCSCard * FCSTalonStateWithLocations::GetTalon int  Position  )  [virtual]
 

Parameters:
Position is the position of the talon card
Returns:
A pointer to the talon card

Definition at line 713 of file FCTalonState.cpp.

References FCSTalonStateData::GetTalon(), and GetTalonData().

Referenced by CheckStateValidity(), CreateInitialState(), and StateAsString().

virtual FCSTalonStateData* FCSTalonStateWithLocations::GetTalonData  )  [pure virtual]
 

Returns:
A pointer to all the talon data

Implemented in FCSIndirectTalonStateWithLocations.

Referenced by CheckStateValidity(), CreateInitialState(), GetTalon(), and StateAsString().

void FCSTalonStateWithLocations::StateAsString char *  String,
FCSDebugDisplayInfo DebugInfo
[virtual]
 

Parameters:
DebugInfo contains debug information that can be included in the string
String is the pointer to the string

Reimplemented from FCSStateWithLocations.

Definition at line 506 of file FCTalonState.cpp.

References DEBUG_CANONIZED_ORDER_OUTPUT, DEBUG_DISPLAY_10_AS_T, DEBUG_IS_OUTPUT_PARSEABLE, FCSStateWithLocations::GetFoundation(), FCSStateWithLocations::GetFreecellCard(), FCSStateWithLocations::GetStackCard(), FCSStateWithLocations::GetStackLength(), GetTalon(), GetTalonData(), FCSDebugDisplayInfo::m_DisplayDebug, FCSDebugDisplayInfo::m_DisplayDebugOptions, FCSStateWithLocations::m_FreecellLocations, FCSDebugDisplayInfo::m_NumberOfDecks, FCSDebugDisplayInfo::m_NumberOfFreecells, FCSDebugDisplayInfo::m_NumberOfStacks, FCSStateWithLocations::m_StackLocations, FCSDebugDisplayInfo::m_TalonType, min, FCSCard::Perl2User(), and FCSCard::Perl2UserCardNumber().


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