Annotation of DewFind/GameBoard.h, revision 1.1.1.1
1.1 nick 1: #pragma once
2:
3: #include "Dewconst.h"
4: #include "Word.h"
5: #include "GameSquare.h"
6: #include <string>
7:
8: using std::string;
9:
10: class GameBoard
11: {
12: public:
13: GameBoard();
14: ~GameBoard();
15: void DrawBoard(CDC *xDC);
16: void DrawWords(CDC *xDC);
17: void LoadWordsFromFile(CString FN);
18: void ClearBoard();
19: void ClearWords();
20: void ClearSelected();//Sets all Selected to false
21: void SetUpBoard();
22: bool IsGameOver();//Checks if all words are found
23: bool SelectSquareMouse(int x,int y);
24: int GetWordCount();
25: int GetWordsFound();
26: private:
27: //Functions
28: void CreateAcross(int wordnumber);
29: void CreateDown(int wordnumber);
30: void CreateDiagonally(int wordnumber);
31: void AddWord(CString word);
32: void FillRandom(); //Fills onused squares with a char
33:
34: void SelectSquare(int x, int y);
35: void CheckWords();
36: void WordFound(int wordnumber);
37: bool HandleAcross(int wordnumber);
38: bool RandomAcross(int wordnumber);
39: bool PlaceAcross(int boardx,int boardy,CString word,int wordnumber);
40: bool HandleDown(int wordnumber);
41: bool RandomDown(int wordnumber);
42: bool PlaceDown(int boardx,int boardy,CString word,int wordnumber);
43: int CheckLoc(int selx,int sely, int X,int X2,int Y,int Y2,int RTN);
44: CString ChangeToBackward(int wordnumber);
45: CString HandleBackward(int wordnumber);
46: bool HandleSelection(int square);
47: char RandomLetter();//Returns a random Letter A-Z
48: //Values
49: GameSquare board_[MAXROW][MAXCOL]; //used to show the board
50: int selects_; //number of letters selected
51: int wordcount_; //count of words
52: bool foundword_[MAXWORDS];
53: CString words_[MAXWORDS];
54: };
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>