Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | List of all members
core::battle::view::PeoplemonAnimation Class Reference

Helper for rendering peoplemon in battle and animating them. More...

#include <PeoplemonAnimation.hpp>

Public Types

enum  Position { Player , Opponent }
 Which position the peoplemon is in. More...
 

Public Member Functions

 PeoplemonAnimation (bl::engine::Engine &engine, Position position)
 Construct a new Peoplemon Animation utility. More...
 
 ~PeoplemonAnimation ()
 Frees resources. More...
 
void init (bl::rc::scene::CodeScene *scene)
 Initializes rendering resources. More...
 
void setPeoplemon (pplmn::Id ppl)
 Sets the specific peoplemon graphic and resets to hidden state. More...
 
void triggerAnimation (const cmd::Animation &anim)
 Begins playing the given animation. More...
 
void triggerAnimation (cmd::Animation::Type type)
 Begins playing the given animation by type only. More...
 
bool completed () const
 Returns true if the animation has completed, false if in progress. More...
 
void update (float dt)
 Updates the playing animation. More...
 
void render (bl::rc::scene::CodeScene::RenderContext &ctx)
 Renders the peoplemon animation. More...
 

Detailed Description

Helper for rendering peoplemon in battle and animating them.

Definition at line 23 of file PeoplemonAnimation.hpp.

Member Enumeration Documentation

◆ Position

Which position the peoplemon is in.

Enumerator
Player 
Opponent 

Definition at line 28 of file PeoplemonAnimation.hpp.

Constructor & Destructor Documentation

◆ PeoplemonAnimation()

core::battle::view::PeoplemonAnimation::PeoplemonAnimation ( bl::engine::Engine &  engine,
Position  position 
)

Construct a new Peoplemon Animation utility.

Parameters
engineThe game engine instance
positionWhich position and orientation for the peoplemon

Definition at line 101 of file PeoplemonAnimation.cpp.

◆ ~PeoplemonAnimation()

core::battle::view::PeoplemonAnimation::~PeoplemonAnimation ( )

Frees resources.

Definition at line 108 of file PeoplemonAnimation.cpp.

Member Function Documentation

◆ completed()

bool core::battle::view::PeoplemonAnimation::completed ( ) const

Returns true if the animation has completed, false if in progress.

Definition at line 342 of file PeoplemonAnimation.cpp.

◆ init()

void core::battle::view::PeoplemonAnimation::init ( bl::rc::scene::CodeScene *  scene)

Initializes rendering resources.

Parameters
sceneThe scene to use

Definition at line 112 of file PeoplemonAnimation.cpp.

◆ render()

void core::battle::view::PeoplemonAnimation::render ( bl::rc::scene::CodeScene::RenderContext &  ctx)

Renders the peoplemon animation.

Parameters
ctxThe render context

Definition at line 585 of file PeoplemonAnimation.cpp.

◆ setPeoplemon()

void core::battle::view::PeoplemonAnimation::setPeoplemon ( pplmn::Id  ppl)

Sets the specific peoplemon graphic and resets to hidden state.

Parameters
pplThe peoplemon to render

Definition at line 188 of file PeoplemonAnimation.cpp.

◆ triggerAnimation() [1/2]

void core::battle::view::PeoplemonAnimation::triggerAnimation ( cmd::Animation::Type  type)

Begins playing the given animation by type only.

Parameters
typeThe animation to play

◆ triggerAnimation() [2/2]

void core::battle::view::PeoplemonAnimation::triggerAnimation ( const cmd::Animation anim)

Begins playing the given animation.

Parameters
animThe animation to play

◆ update()

void core::battle::view::PeoplemonAnimation::update ( float  dt)

Updates the playing animation.

Parameters
dtTime elapsed in seconds

Definition at line 344 of file PeoplemonAnimation.cpp.

Member Data Documentation

◆ alpha

float core::battle::view::PeoplemonAnimation::alpha

Definition at line 102 of file PeoplemonAnimation.hpp.

◆ arrowTime

float core::battle::view::PeoplemonAnimation::arrowTime

Definition at line 105 of file PeoplemonAnimation.hpp.

◆ ballTime

float core::battle::view::PeoplemonAnimation::ballTime

Definition at line 104 of file PeoplemonAnimation.hpp.

◆ bounceTime

float core::battle::view::PeoplemonAnimation::bounceTime

Definition at line 107 of file PeoplemonAnimation.hpp.

◆ shakeTime

float core::battle::view::PeoplemonAnimation::shakeTime

Definition at line 103 of file PeoplemonAnimation.hpp.

◆ slideAmount

float core::battle::view::PeoplemonAnimation::slideAmount

Definition at line 101 of file PeoplemonAnimation.hpp.

◆ throwX

float core::battle::view::PeoplemonAnimation::throwX

Definition at line 106 of file PeoplemonAnimation.hpp.


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