QuestWeaver
A procedural quest generator
weave::WeaverConfig Struct Reference

Holds the configuration data to create new QuestWeaver instances. More...

#include <WeaverConfig.h>

Collaboration diagram for weave::WeaverConfig:

Public Member Functions

 WeaverConfig ()=default
 Creates a new config using default values. More...
 
 WeaverConfig (uint64_t seed)
 Creates a new config using default values and the given seed. More...
 

Public Attributes

Directories dirs
 The directories in which the templates and other files can be found in. More...
 
FormatterType formatterType = FormatterType::TEXT
 Defines how the quest texts such as objectives or description will be formatted. More...
 
std::vector< std::unique_ptr< QuestTemplateFactory > > questTemplateFactories
 The template factories used to create new quest templates. More...
 
std::shared_ptr< RandomStreamrandomStream
 OPTIONAL Can be used to supply the quest system with a custom random number generator. More...
 
uint64_t seed = 0
 The random seed used to create new quests. More...
 
std::vector< std::unique_ptr< StoryTemplateFactory > > storyTemplateFactories
 The template factories used to create the quest stories. More...
 
std::unique_ptr< WorldModelworldModel
 The world model is responsible for creating all quest entities and informs about world changes. More...
 

Detailed Description

Holds the configuration data to create new QuestWeaver instances.

See also
QuestWeaver

Definition at line 19 of file WeaverConfig.h.

Constructor & Destructor Documentation

weave::WeaverConfig::WeaverConfig ( )
default

Creates a new config using default values.

Please note that the config is not valid as long as no world model is assigned to it.

weave::WeaverConfig::WeaverConfig ( uint64_t  seed)
inlineexplicit

Creates a new config using default values and the given seed.

Please note that the config is not valid as long as no world model is assigned to it.

Definition at line 79 of file WeaverConfig.h.

Member Data Documentation

Directories weave::WeaverConfig::dirs

The directories in which the templates and other files can be found in.

Also allows to define a mod directory which can overwrite the default directory for selected files.

Definition at line 33 of file WeaverConfig.h.

FormatterType weave::WeaverConfig::formatterType = FormatterType::TEXT

Defines how the quest texts such as objectives or description will be formatted.

This value cannot be changed later, so choose wisely.

Definition at line 58 of file WeaverConfig.h.

std::vector<std::unique_ptr<QuestTemplateFactory> > weave::WeaverConfig::questTemplateFactories

The template factories used to create new quest templates.

At least one factory has to be registered before trying to create new quests.

Definition at line 46 of file WeaverConfig.h.

std::shared_ptr<RandomStream> weave::WeaverConfig::randomStream

OPTIONAL Can be used to supply the quest system with a custom random number generator.

If a nullptr is provided, the default RNG implementation with the provided seed will be used. If a custom RNG is provided, the caller is responsible for the initial seeding of the stream.

Definition at line 67 of file WeaverConfig.h.

uint64_t weave::WeaverConfig::seed = 0

The random seed used to create new quests.

Quest Systems initialized with the same seed create the same stream of quests (given the quests are initialized and completed the same way). If a random stream is provided instead, the seed is ignored.

Definition at line 27 of file WeaverConfig.h.

std::vector<std::unique_ptr<StoryTemplateFactory> > weave::WeaverConfig::storyTemplateFactories

The template factories used to create the quest stories.

These are optional, but without them, the quests will be created without a backstory.

Definition at line 52 of file WeaverConfig.h.

std::unique_ptr<WorldModel> weave::WeaverConfig::worldModel

The world model is responsible for creating all quest entities and informs about world changes.

MUST be initialized by the caller before creating a new QuestWeaver instance.

Definition at line 40 of file WeaverConfig.h.


The documentation for this struct was generated from the following file: