QuestWeaver
A procedural quest generator
weave Namespace Reference

Classes

struct  ContractFailedException
 The main exception type used by all classes of the QuestWeaver system. More...
 
struct  Directories
 This struct hold information about the programs file search paths. More...
 
struct  EnumClassHash
 Operator to enable the use of enums as keys in maps. More...
 
class  Logger
 The logger used to print errors and debug messages. More...
 
class  MetaData
 Holds information about a world entity. More...
 
class  NameGenerator
 
class  Nugget
 
class  NuggetOption
 
class  PropertyCandidate
 
class  Quest
 Represents a game quest. More...
 
class  QuestModelAction
 These actions are used by the quest system to change the state of quests. More...
 
class  QuestTemplate
 Defines a blueprint from which a specific type of quest can be generated. More...
 
class  QuestTemplateFactory
 A factory that is able to create different "types" of quests (quest templates) on demand. More...
 
class  QuestTickResult
 Event generated by a quest when ticked by the game. More...
 
class  QuestWeaver
 Main entry point for applications using the quest system. More...
 
class  RandomStream
 RNG used by the quest system. More...
 
struct  RawStoryToken
 
struct  Story
 
class  StoryTemplate
 
class  StoryTemplateFactory
 
struct  StoryTemplateResult
 
class  StoryWriter
 
class  StoryWriterParameters
 
class  TemplateQuestDescription
 Wraps the quest description texts for the QuestTemplate. More...
 
struct  WeaverConfig
 Holds the configuration data to create new QuestWeaver instances. More...
 
class  WorldEntity
 Represents an object in the game that is relevant for the quest system. More...
 
class  WorldListener
 Can be attached to a WorldModel to receive change updates. More...
 
class  WorldModel
 Holds information about all entities relevant for quests and quest generation. More...
 
class  WorldModelAction
 Contains change information for a WorldModel entity. More...
 

Typedefs

typedef std::unordered_map< std::string, std::vector< std::shared_ptr< WorldEntity > > > EntityMap
 
typedef uint64_t ID
 Used to identify unique objects in the quest system, i.e. More...
 
typedef std::unordered_map< ID, const QuestPropertyValue * > QuestValueMap
 
typedef std::vector< std::pair< RawStoryToken, std::vector< ID > > > TokenMapping
 
typedef std::unordered_map< std::string, std::vector< ID > > TokenToEntityMap
 

Enumerations

enum  FormatterType { FormatterType::TEXT, FormatterType::HTML }
 Defines the possible output formats of the texts produced by the quest system. More...
 
enum  NameType {
  NameType::DARK_PERSON, NameType::DARK_THING, NameType::LIGHT_PERSON, NameType::LIGHT_THING,
  NameType::FUNNY, NameType::ALIEN, NameType::CORPORATION, NameType::SHIP,
  NameType::CUDDLY, NameType::CUDDLY_VERB, NameType::VENERABLE
}
 
enum  QuestActionType { QuestActionType::KEEP, QuestActionType::ACTIVATE, QuestActionType::FAIL, QuestActionType::SUCCEED }
 Describes the action the quest model should execute for a quest. More...
 
enum  QuestState {
  QuestState::Unknown, QuestState::Inactive, QuestState::Active, QuestState::Failed,
  QuestState::Success
}
 Defines the different states a quest can have. More...
 
enum  StreamType { StreamType::JSON, StreamType::BINARY }
 Defines the possible serialization types of the quest system. More...
 
enum  WorldActionType { WorldActionType::KEEP, WorldActionType::CREATE, WorldActionType::DELETE, WorldActionType::UPDATE }
 The different types of possible world model changes. More...
 

Functions

std::vector< RawStoryTokengetStoryTokens (std::string rawStoryText) noexcept
 
std::string htmlEncloseWithTag (const std::string &str, const std::string &tag, const std::vector< std::string > &classes) noexcept
 Encloses a given string with an HTML tag and adds the given classes as "class" attribute. More...
 
std::string htmlEncloseWithTag (const std::string &str, const std::string &tag) noexcept
 Encloses a given string with an HTML tag. More...
 
std::string htmlEncloseWithTag (const std::string &str, const std::string &tag, const std::string &cssClass) noexcept
 Encloses a given string with an HTML tag and adds the given CSS class. More...
 
Json::Value readJsonFromFile (const char *fileName, const Directories &dirs)
 Reads and parses the given file as JSON. More...
 
bool replace (std::string *str, const std::string &from, const std::string &to) noexcept
 Replaces the first occurrence of a given string with another string. More...
 
void replaceAll (std::string *str, const std::string &from, const std::string &to) noexcept
 Replaces all occurrences of a given string with another string. More...
 

Typedef Documentation

typedef std::unordered_map<std::string, std::vector<std::shared_ptr<WorldEntity> > > weave::EntityMap

Definition at line 15 of file StoryTemplate.h.

typedef std::unordered_map<ID, const QuestPropertyValue *> weave::QuestValueMap

Definition at line 16 of file StoryWriter.h.

typedef std::vector<std::pair<RawStoryToken, std::vector<ID> > > weave::TokenMapping

Definition at line 27 of file StoryTemplate.h.

typedef std::unordered_map<std::string, std::vector<ID> > weave::TokenToEntityMap

Definition at line 28 of file StoryTemplate.h.

Enumeration Type Documentation

enum weave::NameType
strong
Enumerator
DARK_PERSON 
DARK_THING 
LIGHT_PERSON 
LIGHT_THING 
FUNNY 
ALIEN 
CORPORATION 
SHIP 
CUDDLY 
CUDDLY_VERB 
VENERABLE 

Definition at line 286 of file WeaverTypes.h.

Describes the action the quest model should execute for a quest.

Enumerator
KEEP 

Keep a quest in the model.

ACTIVATE 

Activate an inactive quest.

FAIL 

Set an active quest to the failed state.

SUCCEED 

Set an active quest to the succeeded state.

Definition at line 16 of file QuestModelAction.h.

Function Documentation

std::vector<RawStoryToken> weave::getStoryTokens ( std::string  rawStoryText)
noexcept