stmm-games-doc  0.32.0
Public Member Functions | Protected Member Functions | List of all members
stmg::LayoutCtx Class Reference
Inheritance diagram for stmg::LayoutCtx:
Inheritance graph
[legend]

Public Member Functions

 LayoutCtx (const shared_ptr< AppPreferences > &refAppPreferences, Named &oNamed, const File &oFile)
 
int32_t getContextTeam () const override
 The context team. More...
 
int32_t getContextMate () const override
 The context mate. More...
 
std::string getName () const
 
Level::InitgetLevelInit ()
 
int32_t boardGetWidth () const
 
int32_t boardGetHeight () const
 
const std::vector< Tile > & boardGet () const
 
int32_t showGetWidth () const
 
int32_t showGetHeight () const
 
int32_t showGetInitialX () const
 
int32_t showGetInitialY () const
 
bool subshowIsSet () const
 
int32_t subshowGetWidth () const
 
int32_t subshowGetHeight () const
 
int32_t getInitialFallEachTicks () const
 
- Public Member Functions inherited from stmg::GameInfoCtx
 GameInfoCtx (const shared_ptr< AppConfig > &refAppConfig, const File &oGameFile)
 
 GameInfoCtx (const shared_ptr< AppPreferences > &refAppPreferences, Named &oNamed, const File &oGameFile)
 
const GameConstraintsgetGameConstraints () const
 
const shared_ptr< HighscoresDefinition > & getHighscoresDefinition () const
 
const NamedObjIndex< Variable::VariableType > & getGameVariableTypes () const
 
const NamedObjIndex< Variable::VariableType > & getTeamVariableTypes () const
 
const NamedObjIndex< Variable::VariableType > & getMateVariableTypes () const
 
const NamedObjIndex< Variable::VariableType > & getVariableTypes (OwnerType eOwnerType) const
 
std::pair< int32_t, OwnerTypegetVariableIdAndOwnerType (const std::string &sVarName) const
 
double getMinGameInterval () const
 Get minimum game interval. More...
 
double getInitialGameInterval () const
 Get initial game interval. More...
 
int32_t getMaxViewTicks () const
 Get the maximum number of view ticks in a game interval. More...
 
int32_t getAdditionalHighscoresWait () const
 Get additional time in milliseconds for highscores to appear when game ended. More...
 
std::tuple< double, double, double > getSoundScales () const
 The sound scales from tiles to sound coordinates. More...
 
int32_t getBoardPainterIdx () const
 
int32_t getBlockPainterIdx () const
 
- Public Member Functions inherited from stmg::ConditionalCtx
 ConditionalCtx (const shared_ptr< AppPreferences > &refAppPreferences, Named &oNamed)
 
 ConditionalCtx (const shared_ptr< AppConfig > &refAppConfig, Named &oNamed)
 
void addChecker (const xmlpp::Element *p0Element) override
 Adds a checker for the element. More...
 
void removeChecker (const xmlpp::Element *p0Element, bool bCheckChildElements, bool bCheckAttrs) override
 Removes a checker for the element. More...
 
- Public Member Functions inherited from stmg::ParserCtx
 ParserCtx (const shared_ptr< AppConfig > &refAppConfig, Named &oNamed)
 Constructor. More...
 
 ParserCtx (const shared_ptr< AppPreferences > &refAppPreferences, Named &oNamed)
 Constructor. More...
 
virtual ~ParserCtx ()
 
const shared_ptr< AppConfig > & appConfig ()
 The app config. More...
 
const shared_ptr< AppPreferences > & appPreferences ()
 The app preferences. More...
 
Namednamed ()
 The named assets. More...
 
void pushCtx (const std::string &sStr)
 Push a context. More...
 
void popCtx ()
 Pop a context. More...
 
void addValidChildElementName (const xmlpp::Element *p0Element, const std::string &sChildElementName)
 Declares a child element name as valid. More...
 
void addValidChildElementNames (const xmlpp::Element *p0Element, const std::string &sChildElementName)
 Declares a child element name as valid. More...
 
template<typename ... Names>
void addValidChildElementNames (const xmlpp::Element *p0Element, const std::string &sChildElementName, const Names &... oNames)
 Declares multiple child element names as valid. More...
 
void addValidAttrName (const xmlpp::Element *p0Element, const std::string &sAttrName)
 Declares an attribute name as valid. More...
 
void addValidAttrNames (const xmlpp::Element *p0Element, const std::string &sAttrName)
 Declares an attribute name as valid. More...
 
template<typename ... Names>
void addValidAttrNames (const xmlpp::Element *p0Element, const std::string &sAttrName, const Names &... oNames)
 Declares attribute names as valid. More...
 
void removeChecker (const xmlpp::Element *p0Element, bool bCheck)
 Removes a checker for the element. More...
 
std::runtime_error error (const std::string &sErr)
 Creates an exception for the current context. More...
 
void dump () const
 

Protected Member Functions

void setTeam (int32_t nTeam)
 
void setMate (int32_t nMate)
 
void setName (const std::string &sGameName)
 
- Protected Member Functions inherited from stmg::GameInfoCtx
std::string err (const std::string &sErr) override
 Builds complete error string from context. More...
 
- Protected Member Functions inherited from stmg::ParserCtx
std::vector< Checker >::iterator getChecker (const xmlpp::Element *p0Element)
 

Additional Inherited Members

- Static Public Member Functions inherited from stmg::ParserCtx
static int32_t getLine (const xmlpp::Element *p0Element, const std::string &sAttr)
 The line number within a document of an element or attribute. More...
 
- Protected Attributes inherited from stmg::ParserCtx
const shared_ptr< AppConfigm_refAppConfig
 
shared_ptr< AppPreferencesm_refAppPreferences
 
Namedm_oNamed
 
std::vector< std::string > m_oStack
 
std::vector< Checkerm_aCheckers
 

Constructor & Destructor Documentation

◆ LayoutCtx()

stmg::LayoutCtx::LayoutCtx ( const shared_ptr< AppPreferences > &  refAppPreferences,
Named oNamed,
const File oFile 
)
inline

Member Function Documentation

◆ boardGet()

const std::vector< Tile >& stmg::LayoutCtx::boardGet ( ) const
inline

◆ boardGetHeight()

int32_t stmg::LayoutCtx::boardGetHeight ( ) const
inline

◆ boardGetWidth()

int32_t stmg::LayoutCtx::boardGetWidth ( ) const
inline

◆ getContextMate()

int32_t stmg::LayoutCtx::getContextMate ( ) const
inlineoverridevirtual

The context mate.

Default implementation returns -1.

Returns
The context mate or -1.

Reimplemented from stmg::ConditionalCtx.

◆ getContextTeam()

int32_t stmg::LayoutCtx::getContextTeam ( ) const
inlineoverridevirtual

The context team.

The preferences team number (not the level team number).

Default implementation returns -1.

Returns
The context team or -1.

Reimplemented from stmg::ConditionalCtx.

◆ getInitialFallEachTicks()

int32_t stmg::LayoutCtx::getInitialFallEachTicks ( ) const
inline

◆ getLevelInit()

Level::Init& stmg::LayoutCtx::getLevelInit ( )
inline

◆ getName()

std::string stmg::LayoutCtx::getName ( ) const
inline

◆ setMate()

void stmg::LayoutCtx::setMate ( int32_t  nMate)
inlineprotected

◆ setName()

void stmg::LayoutCtx::setName ( const std::string &  sGameName)
inlineprotected

◆ setTeam()

void stmg::LayoutCtx::setTeam ( int32_t  nTeam)
inlineprotected

◆ showGetHeight()

int32_t stmg::LayoutCtx::showGetHeight ( ) const
inline

◆ showGetInitialX()

int32_t stmg::LayoutCtx::showGetInitialX ( ) const
inline

◆ showGetInitialY()

int32_t stmg::LayoutCtx::showGetInitialY ( ) const
inline

◆ showGetWidth()

int32_t stmg::LayoutCtx::showGetWidth ( ) const
inline

◆ subshowGetHeight()

int32_t stmg::LayoutCtx::subshowGetHeight ( ) const
inline

◆ subshowGetWidth()

int32_t stmg::LayoutCtx::subshowGetWidth ( ) const
inline

◆ subshowIsSet()

bool stmg::LayoutCtx::subshowIsSet ( ) const
inline