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

FCState.cpp File Reference

This file contains the implementation of the base freecell state classes. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "FCState.h"
#include "FCTalonState.h"
#include "FCDebugState.h"
#include "FCCompactState.h"
#include "FCIndirectState.h"
#include "FCSDebugStateWithLocations.h"
#include "FCSCompactStateWithLocations.h"
#include "FCSIndirectStateWithLocations.h"
#include "FCSTalonStateWithLocations.h"

Go to the source code of this file.

Defines

#define min(a, b)   ((a)<(b)?(a):(b))
 The minimum of two values.

Functions

int GetFCSStateWithLocationsClassSize ()
 Get the size of the child FCSStateWithLocations class.
FCSStateWithLocationsCreateStateWithLocations ()
 Create a FCSStateWithLocations object.
AFCSStateWithLocationsMatrixCreateStateWithLocationsMatrix (int Size)
 Create a AFCSStateWithLocationsMatrix object.
void ReallocStateWithLocationsArray (FCSStateWithLocations ***Array, int OldSize, int NewSize)
 Reallocate an array of FCSStateWithLocations pointers.
FCSStateWithLocationsCreateInitialState (const char *String, int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks, FCSTalonType TalonType)
 Convert a string representation of a state into a FCSStateWithLocations object.

Variables

FCStateType GlobalStateType = FC_DEBUG_STATE
 The state type currently being used by the solver.
const char *const FreecellsPrefixes [] = { "FC:", "Freecells:", "Freecell:", ""}
 String freecell prefixes.
const char *const FoundationsPrefixes [] = { "Decks:", "Deck:", "Founds:", "Foundations:", "Foundation:", "Found:", ""}
 String foundation prefixes.


Detailed Description

Author:
Michael Mann
Version:
1.0
Date:
August 2002

Definition in file FCState.cpp.


Function Documentation

FCSStateWithLocations* CreateInitialState const char *  String,
int  NumberOfFreecells,
int  NumberOfStacks,
int  NumberOfDecks,
FCSTalonType  TalonType
 

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 for the card game (if applicable)
Returns:
A pointer to the newly created FCSStateWithLocations object

Definition at line 610 of file FCState.cpp.

References FCSStateWithLocations::CreateInitialState(), and FCSTalonStateWithLocations::CreateInitialState().

Referenced by FCCommandLineArguments::Verify().

FCSStateWithLocations* CreateStateWithLocations  ) 
 

Parameters:
NumberOfStacks is the number of stack in the state (used for indirect states)
Returns:
Pointer to the newly created FCSStateWithLocations object

Definition at line 539 of file FCState.cpp.

References GlobalStateType.

Referenced by FCSTalonStateWithLocations::CreateInitialState(), FCSStateWithLocations::CreateInitialState(), main(), FCSMoveStack::Normalize(), and TestEachGame().

AFCSStateWithLocationsMatrix* CreateStateWithLocationsMatrix int  Size  ) 
 

Parameters:
Size is the number of FCSStateWithLocations pointers to create
Returns:
Pointer to the newly created array

Definition at line 560 of file FCState.cpp.

References GlobalStateType.

Referenced by FCSFreecellData::FCSFreecellData(), FCSDFSSolvingAlgorithm< SolvingAlgorithmType >::Solve(), and FCSFreecellData::TraceSolution().

int GetFCSStateWithLocationsClassSize  ) 
 

Returns:
Size of the child FCSStateWithLocations class

Definition at line 518 of file FCState.cpp.

References GlobalStateType.

Referenced by FCSFreecellData::FCSFreecellData().

void ReallocStateWithLocationsArray FCSStateWithLocations ***  Array,
int  OldSize,
int  NewSize
 

The normal realloc was insufficient to handle this becuase of the different FCSStateWithLocations types

Parameters:
Array is a pointer to the FCSStateWithLocations pointer array that will be modified
OldSize is the old size of the array
NewSize is the new desired size of the array

Definition at line 581 of file FCState.cpp.

References GlobalStateType.

Referenced by FCSDerivedStatesList::AddState().


Generated on Sat Nov 5 11:20:16 2005 for Cpp Freecell Solver by  doxygen 1.4.4