XJ music engine  1.9.6
In-game runtime engine for XJ music.
Public Member Functions | Friends | List of all members
XJ::MemeCategory Class Reference

#include <MemeTaxonomy.h>

Public Member Functions

 MemeCategory ()=default
 
 MemeCategory (const std::string *raw)
 
 MemeCategory (const MapStringToOneOrManyString &data)
 
std::string getName () const
 
std::set< std::string > getMemes () const
 
bool isAllowed (std::set< std::string > &targets) const
 
bool hasMemes () const
 
MapStringToOneOrManyString toMap () const
 
std::string toString () const
 

Friends

bool operator< (const MemeCategory &lhs, const MemeCategory &rhs)
 

Detailed Description

One category of memes in the taxonomy

Constructor & Destructor Documentation

◆ MemeCategory() [1/3]

XJ::MemeCategory::MemeCategory ( )
default

◆ MemeCategory() [2/3]

MemeCategory::MemeCategory ( const std::string *  raw)
explicit

Construct a category from a raw string like "CATEGORY[MEME1, MEME2]"

Parameters
rawThe raw string

◆ MemeCategory() [3/3]

MemeCategory::MemeCategory ( const MapStringToOneOrManyString data)
explicit

Construct a category from a map like {name: "CATEGORY", memes: ["MEME1", "MEME2"]}

Parameters
dataThe map

Member Function Documentation

◆ getMemes()

std::set< std::string > MemeCategory::getMemes ( ) const

Get the list of memes

Returns
The list of memes

◆ getName()

std::string MemeCategory::getName ( ) const

Get the name of the category

Returns
The name of the category

◆ hasMemes()

bool MemeCategory::hasMemes ( ) const

Whether the category has memes

Returns
True if the category has memes

◆ isAllowed()

bool MemeCategory::isAllowed ( std::set< std::string > &  targets) const

Whether a list of memes is allowed because no more than one matches the category's memes

Parameters
targetsThe list of memes to check
Returns
True if the list is allowed

◆ toMap()

MapStringToOneOrManyString MemeCategory::toMap ( ) const

Convert the category to a map like {name: "CATEGORY", memes: ["MEME1", "MEME2"]}

Returns
The map

◆ toString()

std::string MemeCategory::toString ( ) const

Convert the category to a string like "CATEGORY[MEME1, MEME2]"

Returns
The string

Friends And Related Function Documentation

◆ operator<

bool operator< ( const MemeCategory lhs,
const MemeCategory rhs 
)
friend

Compare two categories by name

Parameters
lhsThe left-hand side category
rhsThe right-hand side category
Returns
True if the left-hand side category is less than the right-hand side category

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