A factory that is able to create different "types" of quests (quest templates) on demand.
More...
#include <QuestTemplateFactory.h>
A factory that is able to create different "types" of quests (quest templates) on demand.
Since all the quest templates are created by the user of the QuestWeaver library, they have to be created somewhere. Subclasses of the QuestTemplateFactory can be registered with QuestWeaver instances which uses them to generate new quests.
The factory is not serialized along with the quest system and has to be re-registered on deserialization.
Definition at line 25 of file QuestTemplateFactory.h.
virtual weave::QuestTemplateFactory::~QuestTemplateFactory |
( |
| ) |
|
|
virtualdefault |
virtual std::shared_ptr<QuestTemplate> weave::QuestTemplateFactory::createFromJsonValues |
( |
const Json::Value & |
root | ) |
const |
|
protectedpure virtual |
Creates a new quest template from the given JSON parameters.
std::shared_ptr<QuestTemplate> weave::QuestTemplateFactory::CreateTemplate |
( |
const std::string & |
templateKey | ) |
|
static std::vector<TemplateQuestDescription> weave::QuestTemplateFactory::extractDescriptions |
( |
const Json::Value & |
root | ) |
|
|
staticprotected |
Helper function to extract quest descriptions from a JSON object.
static std::vector<TemplateQuestProperty> weave::QuestTemplateFactory::extractProperties |
( |
const Json::Value & |
root | ) |
|
|
staticprotected |
Helper function to extract quest properties from a JSON object.
static int weave::QuestTemplateFactory::extractRarity |
( |
const Json::Value & |
root | ) |
|
|
staticprotected |
Helper function to extract quest rarity from a JSON object.
static std::string weave::QuestTemplateFactory::extractTitle |
( |
const Json::Value & |
root, |
|
|
std::shared_ptr< RandomStream > |
randomStream |
|
) |
| |
|
staticprotected |
Helper function to extract a random quest title from a JSON object.
virtual std::vector<const char *> weave::QuestTemplateFactory::getTemplateFiles |
( |
| ) |
const |
|
protectedpure virtual |
virtual std::vector<std::string> weave::QuestTemplateFactory::GetTemplateKeys |
( |
| ) |
|
|
virtual |
Returns a list of all valid template keys, whereas each key represents a different kind of quest template.
std::shared_ptr<RandomStream> weave::QuestTemplateFactory::randomStream |
|
protected |
The random stream instance to use for any random choices regarding the quest template.
Definition at line 71 of file QuestTemplateFactory.h.
The documentation for this class was generated from the following file: