#ifndef _WORD
#define _WORD

#include "MaxLengthConstants.h"

	class Word{

	private:

		char phrase[MaxWordLength]; // copy of the NULL terminated character
									// string passed into object as parameter.

		char formatedWord[MaxWordLength]; // word in secret '** ***' format.

		void formatWord();
		//
		// pre-condition: Private member array 'phrase' is a NULL 
		//                terminated character string.
		//		
		// post-condition: Phrase is stored in an private member array 
		//                 'formatedWord' where each letter is represented 
		//                 by a '*' and spaces as ' '.
		//

		void stringCopy(char source[], char destination[]);
		//
		// pre-conditions: Source is a NULL terminated character string.
		//				   Destination is same length or longer than
		//                 source.
		//
		// post-conditions: Destination will contain a copy of source.
		//

	public:



		Word(){}; // Class must have a default constructor that takes no
				// arguements so that objects can be created if an array of word objects
				// is defined.

		Word(char secretWord[]);
		//
		// pre-condition: secretWord is a NULL terminated character
		//                string.
		//
		// post-condition: Private member variable arrays are initialised.
		//				   Word is formatted into '** ***' secret word
		//                 format.
		//

		void setWord(char secretWord[]);
		//
		// pre-condition: secretWord is a NULL terminated character
		//                string.
		//
		// post-condition: Private member variable arrays are initialised.
		//				   Word is formatted into '** ***' secret word
		//                 format.
		//

		void getFormatedWord(char wordDisplay[MaxWordLength]) const;
		//
		// post-condition: Copies private formatedWord array into 
		//				   array used as parameter.
		//				   The formatedWord contains letters which
		//                 have been guessed correctly.
		//

		int checkLetterInWord(char letter);
		//
		// post-condition: return value = 1 if letter is in word.
		//			       return value = 0 if letter is not in word.
		//				   '*' in formatedWord array will be changed to 'letter'
		//				   if the letter is in the phrase.
		//

		int hasWordBeenGuessed() const;
		//
		// post-condition: Return value = 1 if all letters in word have
		//                 been guessed.
		//				   Return value = 0 if there are letters still
		//				   to be guessed.
		//

		int operator==(const Word & rhs) const;
		//
		//	post-condition: Returns TRUE if the phrase array is equal in both objects.
		//					Returns FALSE if the phrase array is not equal in both objects.
		//

		void getPhrase(char wordDisplay[MaxWordLength]) const;
		//
		// post-conditions: wordDisplay[MaxWordLength] will contain a copy of the unformatted
		//                  phrase.
		//

	};
#endif

