// Dict.h: interface for the CDict class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DICT_H__0A3AEE02_E7A3_11D2_BF69_006008575F73__INCLUDED_)
#define AFX_DICT_H__0A3AEE02_E7A3_11D2_BF69_006008575F73__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

class CDict  
{
public:
	char board_score[225];
	int CheckMove( char *BoardBefore, char *BoardAfter );
	int BestMove( char *board, char *rack );
	int GetLetterScore( char chLetter );
	CDict();
	virtual ~CDict();

private:
	int letter_score[26];
	// Define the type node
	typedef struct node node;
	typedef struct pos pos;

	node *nextarc(node *arc, char L);
	void Gen(pos anchor, pos p, pos dir, char *rack, node *lex, char *board, char *old);
	void GoOn(pos anchor, pos p, pos dir, char L, char *rack, node *newlex, node *oldlex, char *board, char *old);
	char *genmove(char *board, char *rack, node *lex);
	int compare(char *board, char *newboard, node *lex);

	int bestscore;
	char *bestbrd;
   char bestrack[8];
	
	// Member variable for the root node
	node *lexroot;
	
	// Words in structure
	int wds;

	// Items in graph
	int items;

	// variable for dictionary filepath
	const char *dict_filepath;

	// Member function declarations
	node * newnode(char letter, int terminal);
	int nextline(FILE *source,char *line);
	node * buildlexicon(FILE *dict);
	void rev(char *word);
	node * buildword(char *word, int letter, node *current);
	int validword(char *board, pos s, pos e, node *lex);
	int scoreword(char *board, pos s, pos e);


};

#endif // !defined(AFX_DICT_H__0A3AEE02_E7A3_11D2_BF69_006008575F73__INCLUDED_)
