Middle Europe Productions Library  alpha 1.3.3
Public Member Functions | Protected Member Functions | Friends | List of all members
MEP::Drawable Class Reference

MEP::Drawable provides a basic implementation of an object with the ability of display it on a screen. More...

#include <Drawable.h>

Inheritance diagram for MEP::Drawable:
MEP::AnimationPosition MEP::Object MEP::Text MEP::AnimationColor MEP::AnimationObject MEP::TextureObject MEP::Button

Public Member Functions

void _link (std::shared_ptr< bool > _li)
 
std::shared_ptr< bool > _linkAddr ()
 
const std::shared_ptr< bool > _linkAddr () const
 
bool _isLinked () const
 
U_int32 getDrawTag () const
 
void setDrawTag (const U_int32 tag)
 
bool addDrawTag (const U_int32 tag)
 
bool removeDrawTag (const U_int32 tag)
 
virtual void onResize ()
 
 Drawable ()=default
 
virtual bool draw (sf::RenderWindow &)
 
virtual void update (sf::Time &)
 
virtual void entryUpdate (sf::Time &currentTime, bool low=false)
 
virtual void exitUpdate (sf::Time &currentTime, bool low=false)
 
virtual bool isActive () const
 
virtual void debugOutput (std::ostream &out) const
 
virtual ~Drawable ()
 

Protected Member Functions

void notify ()
 
void drawTagDebug (std::ostream &out) const
 

Friends

std::ostream & operator<< (std::ostream &out, const Drawable &x)
 

Detailed Description

MEP::Drawable provides a basic implementation of an object with the ability of display it on a screen.

Constructor & Destructor Documentation

◆ Drawable()

MEP::Drawable::Drawable ( )
default

Default contructor.

◆ ~Drawable()

virtual MEP::Drawable::~Drawable ( )
inlinevirtual

Member Function Documentation

◆ _isLinked()

bool MEP::Drawable::_isLinked ( ) const
inline

Outputs the information about the activity of the link. Boolean value output true when resource is active.

◆ _link()

void MEP::Drawable::_link ( std::shared_ptr< bool >  _li)
inline

Links the notification link. Boolean value output true when resource is active.

◆ _linkAddr() [1/2]

std::shared_ptr<bool> MEP::Drawable::_linkAddr ( )
inline

Outputs the notification link. Boolean value output true when resource is active.

◆ _linkAddr() [2/2]

const std::shared_ptr<bool> MEP::Drawable::_linkAddr ( ) const
inline

Outputs the notification link. Boolean value output true when resource is active.

◆ addDrawTag()

bool MEP::Drawable::addDrawTag ( const U_int32  tag)
inline

Adds the draw tag of a MEP::Drawable. Use MEP::DrawTag here.

Parameters
[in]MEP::Drawable::DrawTag.
Returns
: True - draw tag was added. False - draw tag is already added.

◆ debugOutput()

virtual void MEP::Drawable::debugOutput ( std::ostream &  out) const
inlinevirtual

◆ draw()

virtual bool MEP::Drawable::draw ( sf::RenderWindow &  )
inlinevirtual

Default virtual draw function.

Parameters
[in]window: Reference to a window.
Returns
True if the drawing was successful, or false if there is something wrong with an object and it must be redrawn.

Reimplemented in MEP::TextureObject, MEP::Text, MEP::Object, MEP::AnimationObject, and MEP::AnimationPosition.

◆ drawTagDebug()

void MEP::Drawable::drawTagDebug ( std::ostream &  out) const
inlineprotected

DrawTag output

◆ entryUpdate()

virtual void MEP::Drawable::entryUpdate ( sf::Time &  currentTime,
bool  low = false 
)
inlinevirtual

Default virtual entry update function.

Parameters
[in]currentTime: Current global time.

Reimplemented in MEP::Object, MEP::AnimationPosition, and MEP::AnimationObject.

◆ exitUpdate()

virtual void MEP::Drawable::exitUpdate ( sf::Time &  currentTime,
bool  low = false 
)
inlinevirtual

Default virtual exit update function.

Parameters
[in]currentTime: Current global time.

Reimplemented in MEP::Object, MEP::AnimationPosition, and MEP::AnimationObject.

◆ getDrawTag()

U_int32 MEP::Drawable::getDrawTag ( ) const
inline

Outputs draw tag of a MEP::Drawable Use MEP::DrawTag here.

Returns
: MEP::Drawable::DrawTag.

◆ isActive()

virtual bool MEP::Drawable::isActive ( ) const
inlinevirtual

Default virtual activation status method.

Parameters
[in]currentTime: Current global time.

Reimplemented in MEP::TextureObject, MEP::AnimationPosition, MEP::AnimationObject, and MEP::Object.

◆ notify()

void MEP::Drawable::notify ( )
inlineprotected

Notify the link.

◆ onResize()

virtual void MEP::Drawable::onResize ( )
inlinevirtual

Instructions on what to do when window is being resized.

Reimplemented in MEP::TextureObject, MEP::Text, and MEP::AnimationObject.

◆ removeDrawTag()

bool MEP::Drawable::removeDrawTag ( const U_int32  tag)
inline

Removes the draw tag of a MEP::Drawable. Use MEP::DrawTag here.

Parameters
[in]MEP::Drawable::DrawTag.
Returns
: True - draw tag was deleted. False - draw tag was not set.

◆ setDrawTag()

void MEP::Drawable::setDrawTag ( const U_int32  tag)
inline

Sets the draw tag of a MEP::Drawable. Use MEP::DrawTag here.

Parameters
[in]MEP::Drawable::DrawTag.

◆ update()

virtual void MEP::Drawable::update ( sf::Time &  )
inlinevirtual

Default virtual update function.

Parameters
[in]currentTime: Current global time.

Reimplemented in MEP::Button, MEP::AnimationObject, MEP::AnimationColor, MEP::AnimationPosition, MEP::TextureObject, MEP::Text, and MEP::Object.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Drawable x 
)
friend

Overrdie of the << operator for diagnostic purposes.