getter for user played words

This commit is contained in:
Love 2024-09-12 16:29:05 +02:00
parent 20db1bdcce
commit 316e212ab4
2 changed files with 9 additions and 0 deletions

View File

@ -44,6 +44,10 @@ std::array<std::string, g_NUM_ROLLED_CUBES> rollSides() {
Boggle::Boggle()
: m_showingSides(rollSides()), m_englishWords(Boggle::s_DICTIONARY_FILE) {}
const std::vector<string> &Boggle::playedWords() const{
return m_playedWords;
}
bool Boggle::isWordEnglish(const std::string &word) const {
return m_englishWords.contains(word);
}

View File

@ -23,8 +23,13 @@ public:
static const int s_MIN_WORD_LENGTH = 4;
static const int s_BOARD_SIZE = 4;
public:
Boggle();
/**
* Getter for the users played words
*/
const std::vector<std::string> &playedWords() const;
bool isWordEnglish(const std::string &word) const;
bool isWordLongEnough(const std::string &word) const;
bool isWordPlayed(const std::string &word) const;