00001 #ifndef AFREECELL_GAME_BOARD_H
00002 #define AFREECELL_GAME_BOARD_H
00003
00011
00012
00013 #ifdef _MSC_VER
00014 typedef __int64 integer64;
00016 #define INT64_CONSTANT(c) (c##i64)
00017 #elif defined(__GNUC__)
00018 typedef __int64_t integer64;
00020 #define INT64_CONSTANT(c) (c##ll)
00021 #endif
00022
00024 #define GAME_NAME_LENGTH 32
00025
00027 enum BoardID
00028 {
00029 BOARD_ID_NONE = -1,
00030 BOARD_ID_BAKERS_DOZEN,
00031 BOARD_ID_BAKERS_GAME,
00032 BOARD_ID_BELEAGUERED_CASTLE,
00033 BOARD_ID_CITADEL,
00034 BOARD_ID_CRUEL,
00035 BOARD_ID_DER_KATZENSCHWANZ,
00036 BOARD_ID_DIE_SCHLANGE,
00037 BOARD_ID_EIGHT_OFF,
00038 BOARD_ID_FAN,
00039 BOARD_ID_FORECELL,
00040 BOARD_ID_FREECELL,
00041 BOARD_ID_GNOME_FREECELL,
00042 BOARD_ID_GOOD_MEASURE,
00043 BOARD_ID_GYPSY,
00044 BOARD_ID_KINGS_ONLY_BAKERS_GAME,
00045 BOARD_ID_KLONDIKE,
00046 BOARD_ID_MICROSOFT_FREECELL,
00047 BOARD_ID_PYSOL_BAKERS_GAME,
00048 BOARD_ID_PYSOL_EIGHT_OFF,
00049 BOARD_ID_PYSOL_FREECELL,
00050 BOARD_ID_PYSOL_KINGS_ONLY_BAKERS_GAME,
00051 BOARD_ID_PYSOL_RELAXED_FREECELL,
00052 BOARD_ID_PYSOL_RELAXED_SEAHAVEN_TOWERS,
00053 BOARD_ID_PYSOL_SEAHAVEN_TOWERS,
00054 BOARD_ID_PYSOL_BELEAGUERED_CASTLE,
00055 BOARD_ID_PYSOL_KLONDIKE,
00056 BOARD_ID_PYSOL_STREETS_AND_ALLEYS,
00057 BOARD_ID_RELAXED_FREECELL,
00058 BOARD_ID_RELAXED_SEAHAVEN_TOWERS,
00059 BOARD_ID_SEAHAVEN_TOWERS,
00060 BOARD_ID_SIMPLE_SIMON,
00061 BOARD_ID_SMALL_HARP,
00062 BOARD_ID_STREETS_AND_ALLEYS,
00063 BOARD_ID_WHITEHEAD,
00064 BOARD_ID_YUKON
00065 };
00066
00068 typedef struct BoardName
00069 {
00071 char m_Name[GAME_NAME_LENGTH];
00072
00074 BoardID m_BoardID;
00075
00076 } BoardName;
00077
00078
00079
00080
00081
00082
00083
00084
00086 #define MakeCard(value, suit) (((suit&0x03)<<4)+(value))
00087
00088 #define GetSuit(card) ((card >> 4) & 0x03)
00089
00090 #define GetValue(card) (card&0x0f)
00091
00093 class AFreecellGameBoard
00094 {
00095 public:
00097 virtual ~AFreecellGameBoard();
00098
00102 virtual void Shuffle(int Seed) = 0;
00103
00107 virtual void Deal(char* GameBoard) = 0;
00108
00112 virtual int GetGameBoardSize() = 0;
00113
00114 protected:
00116 AFreecellGameBoard(bool Display10AsT);
00118 AFreecellGameBoard();
00119
00123 virtual int GetNumberOfCardsInDeck();
00124
00132 virtual char* CardToString(char* String, char Card, bool AppendWhiteSpace, bool FlipCondition = false);
00133
00135 char* m_Deck;
00137 bool m_Display10AsT;
00138 };
00139
00145 AFreecellGameBoard* CreateAFreecellGameBoard(char* GameName, bool Display10AsT);
00146
00147
00148 #endif