|
XJ music engine
1.9.6
In-game runtime engine for XJ music.
|
#include <MemeTaxonomy.h>
Public Member Functions | |
| MemeTaxonomy ()=default | |
| MemeTaxonomy (const std::string &raw) | |
| MemeTaxonomy (const std::set< MapStringToOneOrManyString > &data) | |
| std::string | toString () const |
| std::set< MapStringToOneOrManyString > | toList () const |
| std::map< std::string, std::vector< std::string > > | toMap () const |
| std::set< MemeCategory > | getCategories () |
| bool | isAllowed (std::set< std::string > memes) const |
Static Public Member Functions | |
| static MemeTaxonomy | empty () |
| static MemeTaxonomy | fromSet (std::set< MapStringToOneOrManyString > &data) |
| static MemeTaxonomy | fromList (const std::vector< std::map< std::string, std::variant< std::string, std::vector< std::string >>>> &list) |
| static MemeTaxonomy | fromString (const std::string &raw) |
TemplateConfig has Meme categories https://www.pivotaltracker.com/story/show/181801646
A template configuration has a field called memeTaxonomy which defines the taxonomy of memes.
For example, this might look like
That would tell XJ about the existence of a meme category called City with values CHICAGO, DENVER, and PHILADELPHIA. And these would function as exclusion like numeric memes, e.g. after content having CHICAGO is chosen, we can choose nothing with DENVER or PHILADELPHIA.
|
default |
|
explicit |
Construct a taxonomy from a raw string like "CATEGORY1[MEME1, MEME2],CATEGORY2[MEME3, MEME4]"
| raw | The raw string |
|
explicit |
Construct a taxonomy from a list of maps like [{name: "CATEGORY1", memes: ["MEME1", "MEME2"]}, {name: "CATEGORY2", memes: ["MEME3", "MEME4"]}]
| data | The list of maps |
|
static |
Construct an empty taxonomy
|
static |
Construct a taxonomy from a list of maps like [{name: "CATEGORY1", memes: ["MEME1", "MEME2"]}, {name: "CATEGORY2", memes: ["MEME3", "MEME4"]}]
| list | The list of maps |
|
static |
Construct a taxonomy from a set of maps like [{name: "CATEGORY1", memes: ["MEME1", "MEME2"]}, {name: "CATEGORY2", memes: ["MEME3", "MEME4"]}]
| data | The set of maps |
|
static |
Construct an empty taxonomy
| std::set< MemeCategory > MemeTaxonomy::getCategories | ( | ) |
Get the categories
| bool MemeTaxonomy::isAllowed | ( | std::set< std::string > | memes | ) | const |
Whether a list of memes is allowed because they are allowed by all taxonomy categories
| memes | The list of memes to check |
| std::set< MapStringToOneOrManyString > MemeTaxonomy::toList | ( | ) | const |
Convert the taxonomy to a list of maps like [{name: "CATEGORY1", memes: ["MEME1", "MEME2"]}, {name: "CATEGORY2", memes: ["MEME3", "MEME4"]}]
| std::map< std::string, std::vector< std::string > > MemeTaxonomy::toMap | ( | ) | const |
Convert the taxonomy to a map like "{CATEGORY1:[MEME1, MEME2],CATEGORY2:[MEME3, MEME4]}"
| std::string MemeTaxonomy::toString | ( | ) | const |
Convert the taxonomy to a string like "CATEGORY1[MEME1, MEME2],CATEGORY2[MEME3, MEME4]"