#pragma once

#include <filesystem>
#include <mutex>
#include <string>
#include <vector>

class WordRefList;

class WordList : public std::vector<std::string> {
public:
  WordList &multiply(size_t factor);
  WordList &shuffle();

  static WordList oneCap();
  static WordList fourCaps();
  static WordList fromFile(const std::filesystem::path &path);

  static void find_prefix_in_range(const WordList &word_list,
                                   const std::string_view &search_prefix,
                                   size_t start_index, size_t end_index,
                                   WordRefList &result,
                                   std::mutex &result_mutex);
};

class WordRefList : public std::vector<const std::string *> {
public:
  WordRefList() = default;
  WordRefList(const WordList &source);

  static void find_prefix_in_range(const WordRefList &word_list,
                                   const std::string_view &search_prefix,
                                   size_t start_index, size_t end_index,
                                   WordRefList &result,
                                   std::mutex &result_mutex);
};
