From 316e212ab44f9cfc17b122198209ac1fbc975530 Mon Sep 17 00:00:00 2001 From: Love Billenius Date: Thu, 12 Sep 2024 16:29:05 +0200 Subject: [PATCH] getter for user played words --- src/Boggle.cpp | 4 ++++ src/Boggle.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/Boggle.cpp b/src/Boggle.cpp index d6a8532..9c7aaf0 100755 --- a/src/Boggle.cpp +++ b/src/Boggle.cpp @@ -44,6 +44,10 @@ std::array rollSides() { Boggle::Boggle() : m_showingSides(rollSides()), m_englishWords(Boggle::s_DICTIONARY_FILE) {} +const std::vector &Boggle::playedWords() const{ + return m_playedWords; +} + bool Boggle::isWordEnglish(const std::string &word) const { return m_englishWords.contains(word); } diff --git a/src/Boggle.h b/src/Boggle.h index 89709b4..0f8e45a 100755 --- a/src/Boggle.h +++ b/src/Boggle.h @@ -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 &playedWords() const; bool isWordEnglish(const std::string &word) const; bool isWordLongEnough(const std::string &word) const; bool isWordPlayed(const std::string &word) const;