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

#include <MemeStack.h>

Public Member Functions

 MemeStack (MemeTaxonomy taxonomy, const std::set< std::string > &from)
 
bool isAllowed (const std::set< std::string > &targets) const
 
bool isAllowed (const std::set< std::string > &sources, const std::set< std::string > &targets) const
 
bool isValid ()
 
std::string getConstellation () const
 

Static Public Member Functions

static MemeStack from (const MemeTaxonomy &taxonomy, const std::set< std::string > &memes)
 

Detailed Description

Meme Stack is a theorem which tests various axioms for validity when a new member is pending introduction.

Concretely exclude meme combinations in violation of the given axioms:

See also
MemeTaxonomy for how we parse categories of exclusive memes

Constructor & Destructor Documentation

◆ MemeStack()

MemeStack::MemeStack ( MemeTaxonomy  taxonomy,
const std::set< std::string > &  from 
)
explicit

Constructor from taxonomy and memes

Parameters
fromfrom which to create stack

Constructor from taxonomy and memes

Parameters
taxonomytaxonomy
fromfrom which to create stack

Member Function Documentation

◆ from()

MemeStack MemeStack::from ( const MemeTaxonomy taxonomy,
const std::set< std::string > &  memes 
)
static

Construct a meme stack from a set of memes

◆ getConstellation()

std::string MemeStack::getConstellation ( ) const

Constellations report https://github.com/xjmusic/xjmusic/issues/212

Returns
normalized string representation of an unordered set of memes

◆ isAllowed() [1/2]

bool MemeStack::isAllowed ( const std::set< std::string > &  sources,
const std::set< std::string > &  targets 
) const

Test whether an incoming set of memes is allowed by this meme

Parameters
targetsmemes to test
Returns
true if the specified set of memes is allowed into this meme stack

◆ isAllowed() [2/2]

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

Test whether an incoming set of memes is allowed by this meme

Parameters
targetsmemes to test
Returns
true if the specified set of memes is allowed into this meme stack

◆ isValid()

bool MemeStack::isValid ( )

Test whether all of our own memes are allowed, while avoiding testing any meme against itself

Refuse to make a choice that violates the meme stack https://github.com/xjmusic/xjmusic/issues/211

Returns
true if the theorem is valid

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