stmm-games-doc  0.32.0
Public Member Functions | Protected Member Functions | List of all members
stmg::StdThemeAnimationFactory Class Referenceabstract

Base class for ThemeAnimation factories. More...

Inheritance diagram for stmg::StdThemeAnimationFactory:
Inheritance graph
[legend]

Public Member Functions

virtual ~StdThemeAnimationFactory () noexcept=default
 
 StdThemeAnimationFactory (StdTheme *p1Owner) noexcept
 Constructor. More...
 
virtual bool supports (const shared_ptr< LevelAnimation > &refLevelAnimation) noexcept=0
 Tells whether the factory supports the model animation. More...
 
virtual shared_ptr< ThemeAnimationcreate (const shared_ptr< StdThemeContext > &refThemeContext, const shared_ptr< LevelAnimation > &refLevelAnimation) noexcept=0
 Creates a theme animation for a level animation. More...
 
virtual void clearOwner () noexcept
 Clears the owner passed in the constructor. More...
 

Protected Member Functions

StdThemeowner () noexcept
 The owner. More...
 
const StdThemeowner () const noexcept
 The owner. More...
 

Detailed Description

Base class for ThemeAnimation factories.

Constructor & Destructor Documentation

◆ ~StdThemeAnimationFactory()

virtual stmg::StdThemeAnimationFactory::~StdThemeAnimationFactory ( )
virtualdefaultnoexcept

◆ StdThemeAnimationFactory()

stmg::StdThemeAnimationFactory::StdThemeAnimationFactory ( StdTheme p1Owner)
explicitnoexcept

Constructor.

Parameters
p1OwnerThe owner theme. Cannot be null.

Member Function Documentation

◆ clearOwner()

virtual void stmg::StdThemeAnimationFactory::clearOwner ( )
virtualnoexcept

Clears the owner passed in the constructor.

Makes the instance unusable.

◆ create()

virtual shared_ptr<ThemeAnimation> stmg::StdThemeAnimationFactory::create ( const shared_ptr< StdThemeContext > &  refThemeContext,
const shared_ptr< LevelAnimation > &  refLevelAnimation 
)
pure virtualnoexcept

Creates a theme animation for a level animation.

The creation may fail even if supports() returns true.

Parameters
refThemeContextThe theme context. Cannot be null.
refLevelAnimationThe model. Cannot be null.
Returns
The new theme animation instance or null if failed.

Implemented in stmg::PlainTextThAniFactory, stmg::BackgroundThAniFactory, stmg::StaticGridThAniFactory, stmg::ImageSequenceThAniFactory, and stmg::ExplosionThAniFactory.

◆ owner() [1/2]

StdTheme* stmg::StdThemeAnimationFactory::owner ( )
inlineprotectednoexcept

The owner.

Returns
The owner StdTheme.

◆ owner() [2/2]

const StdTheme* stmg::StdThemeAnimationFactory::owner ( ) const
inlineprotectednoexcept

The owner.

Returns
The owner StdTheme.

◆ supports()

virtual bool stmg::StdThemeAnimationFactory::supports ( const shared_ptr< LevelAnimation > &  refLevelAnimation)
pure virtualnoexcept

Tells whether the factory supports the model animation.

Tells whether the class of the model (not the actual model instance) is supported.

Parameters
refLevelAnimationThe level animation (the model). Cannot be null.
Returns
Whether the factory can create a theme animation for the model class.

Implemented in stmg::PlainTextThAniFactory, stmg::BackgroundThAniFactory, stmg::StaticGridThAniFactory, stmg::ImageSequenceThAniFactory, and stmg::ExplosionThAniFactory.