raylibstarter 0.1.0
|
Actor base class. Actors represent all game objects, such as players, enemies and other obstacles. More...
#include <actor.h>
Public Member Functions | |
Actor ()=delete | |
Actor (std::shared_ptr< game::core::Sprite > sprite) | |
Constructor. More... | |
Actor (const game::core::Actor &actor)=delete | |
Actor & | operator= (const Actor &)=delete |
virtual | ~Actor () |
const std::shared_ptr< game::core::Sprite > & | sprite () const |
Returns the sprite object of the actor. More... | |
void | sprite (std::shared_ptr< game::core::Sprite > sprite) |
Replaces the current sprite object of the actor. More... | |
Private Attributes | |
std::shared_ptr< game::core::Sprite > | sprite_ |
Actor base class. Actors represent all game objects, such as players, enemies and other obstacles.
Graphically, actors are represented via a sprite object associated with them. The sprite must be passed in the constructor call.
Actors can be placed in the actor-map of a scene object and will be drawn automatically if their visible attribute is true. If actor objects are supposed to be available across scenes, they can be stored in game::core::actors. Objects that are only referenced there will not be drawn automatically. The position and appearance of an actor object in the game depends on attributes (e.g. position and rotation) of its sprite member.
|
delete |
|
explicit |
|
delete |
const std::shared_ptr< game::core::Sprite > & game::core::Actor::sprite | ( | ) | const |
void game::core::Actor::sprite | ( | std::shared_ptr< game::core::Sprite > | sprite | ) |
|
private |