#ifndef _WORDSOURCE_H
#define _WORDSOURCE_H

#include <string>
#include <iostream>
#include <fstream>
using namespace std;


// this class provides a source of words to use, for example,
// in playing Hangman or other word games
//
// When constructed using the default constructor, the function
// GetWord() returns one of four different words at random, these
// words are "hardwired" into the class
//
// WordSource ws;
// string s = ws.GetWord();   // s is one of four different words
//
// When constructed using a string as a filename, each call of GetWord
// returns a word at random from the file
//
// WordSource ws("words.txt");
// string s = ws.GetWord();   // s is some word in "words.txt"
//


class WordSource
{
  public:
    WordSource();
    WordSource(const string& filename);
    
    string GetWord();
    
  private:

    int      myWordCount;
    string   myFilename;
};

#endif
