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

FCSMove.cpp File Reference

This file contains the implementatino of classes dealing with move objects. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "FCSMove.h"
#include "FCSDebugMove.h"
#include "FCSCompactMove.h"
#include "FCState.h"
#include "FCTalonState.h"
#include "FCHelpingAlgorithms.h"

Go to the source code of this file.

Functions

FCSMoveStackCreateMoveStack ()
 Create a move stack object.
void ReallocMoveStackArray (FCSMoveStack ***Array, int OldSize, int NewSize)
 Reallocate an array of move stack pointers.
void ApplyMove (FCSStateWithLocations *StateWithLocations, FCSMove *Move, int NumberOfFreecells, int NumberOfStacks, int NumberOfDecks)
 Perform a move on a given state.


Detailed Description

Author:
Michael Mann
Version:
1.0
Date:
August 2002

Definition in file FCSMove.cpp.


Function Documentation

void ApplyMove FCSStateWithLocations StateWithLocations,
FCSMove Move,
int  NumberOfFreecells,
int  NumberOfStacks,
int  NumberOfDecks
 

Parameters:
State the move will happen on
Move is the move being performed
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 300 of file FCSMove.cpp.

References FCSStateWithLocations::CanonizeState(), FCSCard::Create(), FCSStateWithLocations::EmptyFreecell(), FCSStateWithLocations::FlipStackCard(), FCSMove::GetDestFreecell(), FCSMove::GetDestStack(), FCSMove::GetFoundation(), FCSStateWithLocations::GetFreecellCard(), FCSMove::GetNumberOfCardsInSequence(), FCSMove::GetSourceFreecell(), FCSMove::GetSourceStack(), FCSStateWithLocations::GetStackLength(), FCSMove::GetType(), FCSStateWithLocations::IncrementFoundation(), FCSStateWithLocations::PopStackCard(), FCSStateWithLocations::PushCardIntoStack(), FCSStateWithLocations::PushStackCardIntoStack(), and FCSStateWithLocations::PutCardInFreecell().

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

FCSMoveStack* CreateMoveStack  ) 
 

Returns:
A pointer to the newly created move stack object

Definition at line 263 of file FCSMove.cpp.

References GlobalStateType.

Referenced by FCSOptimizeSolvingAlgorithm< SolvingAlgorithmType >::CheckStateEnd(), FCSFreecellData::CheckStateEnd(), FCSFreecellData::CreateTotalMovesStack(), FCSFreecellSolvingAlgorithm::EmptyStackIntoFreecells(), FCSTalonSolvingAlgorithm::GetCardFromKlondikeTalon(), FCSFreecellSolvingAlgorithm::MoveCardsToADifferentParent(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToEmptyStack(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveFreecellCardsToTopOfStacks(), FCSFreecellSolvingAlgorithm::MoveNonTopStackCardsToFounds(), FCSFreecellSolvingAlgorithm::MoveSequencesToFreeStacks(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFalseParent(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToParentOnTheSameStack(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToTrueParent(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceToTrueParentWithSomeCardsAbove(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceWithJunkSequenceAboveToTrueParentWithSomeCardsAbove(), FCSSimpleSimonSolvingAlgorithm::MoveSequenceWithSomeCardsAboveToTrueParent(), FCSFreecellSolvingAlgorithm::MoveStackCardsToAParentOnTheSameStack(), FCSFreecellSolvingAlgorithm::MoveStackCardsToDifferentStacks(), FCSFreecellSolvingAlgorithm::MoveTopStackCardsToFounds(), FCSSimpleSimonSolvingAlgorithm::MoveWholeStackSequenceToFalseParent(), FCSSimpleSimonSolvingAlgorithm::MoveWholeStackSequenceToFalseParentWithSomeCardsAbove(), and FCSMoveStack::Normalize().

void ReallocMoveStackArray FCSMoveStack ***  Array,
int  OldSize,
int  NewSize
 

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

Parameters:
Array is a pointer to the move stack 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 280 of file FCSMove.cpp.

References GlobalStateType.

Referenced by FCSSoftDFSSolvingAlgorithm< SolvingAlgorithmType >::IncreaseDFSMaxDepth().


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