ManaPlus
Public Member Functions | Private Attributes
AnimationDelayLoad Class Reference

#include <animationdelayload.h>

Public Member Functions

 AnimationDelayLoad (const std::string &fileName, const int variant, AnimatedSprite *const sprite)
 
 ~AnimationDelayLoad ()
 
void clearSprite ()
 
void load ()
 
void setAction (const std::string &action)
 

Private Attributes

std::string mFileName
 
int mVariant
 
AnimatedSpritemSprite
 
std::string mAction
 

Detailed Description

Definition at line 31 of file animationdelayload.h.

Constructor & Destructor Documentation

◆ AnimationDelayLoad()

AnimationDelayLoad::AnimationDelayLoad ( const std::string &  fileName,
const int  variant,
AnimatedSprite *const  sprite 
)

Definition at line 32 of file animationdelayload.cpp.

34  :
36  mVariant(variant),
37  mSprite(sprite),
39 {
40 }
AnimatedSprite * mSprite
static const std::string STAND("stand")
std::string fileName
Definition: testmain.cpp:39

◆ ~AnimationDelayLoad()

AnimationDelayLoad::~AnimationDelayLoad ( )

Definition at line 42 of file animationdelayload.cpp.

43 {
44  if (mSprite != nullptr)
45  {
47  mSprite = nullptr;
48  }
49 }

References AnimatedSprite::clearDelayLoad(), and mSprite.

Member Function Documentation

◆ clearSprite()

void AnimationDelayLoad::clearSprite ( )

Definition at line 51 of file animationdelayload.cpp.

52 {
53  mSprite = nullptr;
54 }

References mSprite.

Referenced by AnimatedSprite::~AnimatedSprite().

◆ load()

void AnimationDelayLoad::load ( )

Definition at line 56 of file animationdelayload.cpp.

57 {
58  if (mSprite != nullptr)
59  {
61  if (s == nullptr)
62  return;
63  mSprite->setSprite(s);
65  }
66 }
bool play(const std::string &spriteAction)
void setSprite(SpriteDef *const sprite)
SpriteDef * getSprite(const std::string &path, const int variant)

References Loader::getSprite(), mAction, mFileName, mSprite, mVariant, AnimatedSprite::play(), and AnimatedSprite::setSprite().

◆ setAction()

void AnimationDelayLoad::setAction ( const std::string &  action)
inline

Definition at line 46 of file animationdelayload.h.

47  { mAction = action; }

References mAction.

Field Documentation

◆ mAction

std::string AnimationDelayLoad::mAction
private

Definition at line 53 of file animationdelayload.h.

Referenced by load(), and setAction().

◆ mFileName

std::string AnimationDelayLoad::mFileName
private

Definition at line 50 of file animationdelayload.h.

Referenced by load().

◆ mSprite

AnimatedSprite* AnimationDelayLoad::mSprite
private

Definition at line 52 of file animationdelayload.h.

Referenced by clearSprite(), load(), and ~AnimationDelayLoad().

◆ mVariant

int AnimationDelayLoad::mVariant
private

Definition at line 51 of file animationdelayload.h.

Referenced by load().


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