MEP::Object is a container of a sf::Texture it also have built in memory management.
More...
#include <Object.h>
|
| | Object ()=delete |
| |
| | Object (const Object &x) |
| |
| | Object (const U_int32 ID, const std::string &path, const std::string &filename, bool transparencyM=false) |
| |
| | Object (const U_int32 ID, const std::string &path, const std::string &filename, unsigned int frames, bool transparencyM=false) |
| |
| | Object (const U_int32 ID, std::list< sf::Image > &images, const std::string &filename, bool transparencyM=false) |
| |
| virtual const sf::Vector2u & | getSize () const |
| |
| unsigned long | getNufTextures () const |
| |
| bool | draw (sf::RenderWindow &window) override |
| |
| void | update (sf::Time &) override |
| |
| void | entryUpdate (sf::Time ¤tTime, bool low=false) override |
| |
| void | exitUpdate (sf::Time ¤tTime, bool low=false) override |
| |
| Object * | getObjectPoint () |
| |
| Object & | getObjectRef () |
| |
| const U_int32 & | getID () const |
| |
| const std::string & | getName () const |
| |
| virtual bool | isTansparent (unsigned int x, unsigned int y) |
| |
| bool | isActive () const |
| |
| const ObjectType & | getType () const |
| |
| unsigned int | nufC () const |
| |
| bool | operator== (const std::string &x) const |
| |
| bool | operator== (const Object &x) const |
| |
| virtual void | debugOutput (std::ostream &out) const |
| |
| | ~Object () override |
| |
| 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 | ~Drawable () |
| |
MEP::Object is a container of a sf::Texture it also have built in memory management.
MEP::Object keeps a track of all of the shared instances of itself. In will only be possible to delete a MEP::Object when all of the instances are deleted and MEP::Resources deleteObject() method is called.
◆ ObjectType
| Enumerator |
|---|
| NotInit | Object not initialized.
|
| Single | Object is a single texture.
|
| Multi | Object is a list of textures.
|
◆ Object() [1/5]
◆ Object() [2/5]
| MEP::Object::Object |
( |
const Object & |
x | ) |
|
|
inline |
◆ Object() [3/5]
| MEP::Object::Object |
( |
const U_int32 |
ID, |
|
|
const std::string & |
path, |
|
|
const std::string & |
filename, |
|
|
bool |
transparencyM = false |
|
) |
| |
|
inline |
Constructor of an object.
- Parameters
-
| [in] | path | : Path to the resources. |
| [in] | name | : Name of a resource. |
| [in] | transparencyM | : Transparency of a resource. |
◆ Object() [4/5]
| MEP::Object::Object |
( |
const U_int32 |
ID, |
|
|
const std::string & |
path, |
|
|
const std::string & |
filename, |
|
|
unsigned int |
frames, |
|
|
bool |
transparencyM = false |
|
) |
| |
|
inline |
Constructor of an object.
- Parameters
-
| [in] | path | : Path to the resources. |
| [in] | name | : Name of a resource. |
| [in] | frames | : Number of textures. Loading starts from the texture name0 to nameN where N is a number of frames - 1. |
| [in] | transparencyM | : Transparency of a resource. |
◆ Object() [5/5]
| MEP::Object::Object |
( |
const U_int32 |
ID, |
|
|
std::list< sf::Image > & |
images, |
|
|
const std::string & |
filename, |
|
|
bool |
transparencyM = false |
|
) |
| |
|
inline |
Constructor of an object.
- Parameters
-
| [in] | path | : Path to the resources. |
| [in] | name | : Name of a resource. |
| [in] | frames | : Number of textures. Loading starts from the texture name0 to nameN where N is a number of frames - 1. |
| [in] | transparencyM | : Transparency of a resource. |
◆ ~Object()
◆ debugOutput()
| virtual void MEP::Object::debugOutput |
( |
std::ostream & |
out | ) |
const |
|
inlinevirtual |
◆ deleteObject()
| void MEP::Object::deleteObject |
( |
| ) |
|
|
inlineprotected |
◆ draw()
| bool MEP::Object::draw |
( |
sf::RenderWindow & |
window | ) |
|
|
inlineoverridevirtual |
◆ entryUpdate()
| void MEP::Object::entryUpdate |
( |
sf::Time & |
currentTime, |
|
|
bool |
low = false |
|
) |
| |
|
inlineoverridevirtual |
◆ exitUpdate()
| void MEP::Object::exitUpdate |
( |
sf::Time & |
currentTime, |
|
|
bool |
low = false |
|
) |
| |
|
inlineoverridevirtual |
◆ getID()
| const U_int32& MEP::Object::getID |
( |
| ) |
const |
|
inline |
◆ getName()
| const std::string& MEP::Object::getName |
( |
| ) |
const |
|
inline |
◆ getNufTextures()
| unsigned long MEP::Object::getNufTextures |
( |
| ) |
const |
|
inline |
Outputs the number of frames of a MEP::Object
- Returns
- sf:Vector2u size.
◆ getObjectPoint()
| Object* MEP::Object::getObjectPoint |
( |
| ) |
|
|
inline |
◆ getObjectRef()
| Object& MEP::Object::getObjectRef |
( |
| ) |
|
|
inline |
◆ getSize()
| virtual const sf::Vector2u& MEP::Object::getSize |
( |
| ) |
const |
|
inlinevirtual |
◆ getType()
◆ isActive()
| bool MEP::Object::isActive |
( |
| ) |
const |
|
inlinevirtual |
◆ isTansparent()
| bool MEP::Object::isTansparent |
( |
unsigned int |
x, |
|
|
unsigned int |
y |
|
) |
| |
|
inlinevirtual |
Checks the transparency of an object for the default SDL_Rect
- Returns
- true - position has an alpha channel > 100, false - position has an alpha chanel < 100
Reimplemented in MEP::Button, and MEP::AnimationObject.
◆ nufC()
| unsigned int MEP::Object::nufC |
( |
| ) |
const |
|
inline |
Outputs the number of copies of the MEP::Object
- Returns
- Number of copies.
◆ operator==() [1/2]
| bool MEP::Object::operator== |
( |
const Object & |
x | ) |
const |
|
inline |
◆ operator==() [2/2]
| bool MEP::Object::operator== |
( |
const std::string & |
x | ) |
const |
|
inline |
◆ update()
| void MEP::Object::update |
( |
sf::Time & |
| ) |
|
|
inlineoverridevirtual |
◆ operator<<
| std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const Object & |
x |
|
) |
| |
|
friend |
Overrdie of the << operator for diagnostic purposes.
◆ m_size
| sf::Vector2u MEP::Object::m_size = {0, 0} |
|
protected |
◆ m_type
◆ table
| bool** MEP::Object::table = nullptr |
|
protected |
◆ texture
| std::list<sf::Texture*>* MEP::Object::texture |
|
protected |
◆ transparency
| bool MEP::Object::transparency = false |
|
protected |