My Project
Engine Class Reference

#include <game.hpp>

Collaboration diagram for Engine:

Public Types

typedef std::function< void(const std::string &)> Callback
 

Public Member Functions

void start (unsigned int)
 
void setNewWord ()
 
void setWord (const std::string &)
 
std::string getWord ()
 
void registerNewWordCallback (Callback)
 

Static Public Member Functions

static void createInstance ()
 
static void createInstance (const std::string &)
 
static EnginegetInstance ()
 
static void destroyInstance ()
 

Private Member Functions

 Engine ()
 
 Engine (const std::string &f)
 
unsigned int getRandomLine (unsigned int)
 

Private Attributes

std::string currentWord
 
std::vector< std::string > pastWords
 
std::string wordFile
 
bool started = false
 
std::mutex mut
 
std::vector< Callbackcallbacks
 

Static Private Attributes

static Engineinstance
 

Member Typedef Documentation

◆ Callback

typedef std::function<void(const std::string &)> Engine::Callback

Constructor & Destructor Documentation

◆ Engine() [1/2]

Engine::Engine ( )
inlineprivate
Here is the caller graph for this function:

◆ Engine() [2/2]

Engine::Engine ( const std::string &  f)
inlineprivate

Member Function Documentation

◆ createInstance() [1/2]

void Engine::createInstance ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createInstance() [2/2]

void Engine::createInstance ( const std::string &  fileName)
static
Here is the call graph for this function:

◆ destroyInstance()

void Engine::destroyInstance ( )
static

◆ getInstance()

Engine * Engine::getInstance ( )
static
Here is the caller graph for this function:

◆ getRandomLine()

unsigned int Engine::getRandomLine ( unsigned int  max)
private
Here is the caller graph for this function:

◆ getWord()

std::string Engine::getWord ( )
Here is the caller graph for this function:

◆ registerNewWordCallback()

void Engine::registerNewWordCallback ( Callback  )
Here is the caller graph for this function:

◆ setNewWord()

void Engine::setNewWord ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWord()

void Engine::setWord ( const std::string &  w)
Here is the caller graph for this function:

◆ start()

void Engine::start ( unsigned int  interval)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ callbacks

std::vector<Callback> Engine::callbacks
private

◆ currentWord

std::string Engine::currentWord
private

◆ instance

Engine * Engine::instance
staticprivate

◆ mut

std::mutex Engine::mut
private

◆ pastWords

std::vector<std::string> Engine::pastWords
private

◆ started

bool Engine::started = false
private

◆ wordFile

std::string Engine::wordFile
private

The documentation for this class was generated from the following files: