RType
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Drawable Class Reference

#include <Drawable.hpp>

Inheritance diagram for Drawable:
Inheritance graph
[legend]
Collaboration diagram for Drawable:
Collaboration graph
[legend]

Public Member Functions

 Drawable ()
 Construct a new Drawable:: Drawable object. More...
 
char * getAttribute () const
 getAttribute, get the attribute More...
 
void setAttribute (std::string attribute)
 setAttribute, set the attribute More...
 
Position getPosition () const
 getPosition, get the position More...
 
void setPosition (std::tuple< float, float > position)
 setPosition, set the position More...
 
Size getSize () const
 getSize, get the size More...
 
void setSize (std::tuple< float, float > size)
 setSize, set the size More...
 
float getScale () const
 getScale, get the scale More...
 
void setScale (float scale)
 setScale, set the scale More...
 
Rect getRect () const
 getRect, get the rect More...
 
void setRect (std::tuple< int, int, int, int > rect)
 setRect, set the rect More...
 
std::shared_ptr< PacketgetPacket ()
 getPacket, get the packet More...
 
void setHasChanged (bool hasChanged)
 setHasChanged, set if the drawable has changed More...
 
bool getHasChanged () const
 getHasChanged, get if the drawable has changed More...
 
void addDrawableCollision (std::shared_ptr< Drawable > drawableCollision)
 addDrawableCollision, add a drawable collision More...
 
std::vector< std::shared_ptr< Drawable > > getDrawablesCollision () const
 getDrawablesCollision, get the drawables collision More...
 
- Public Member Functions inherited from IComponentRType
virtual ~IComponentRType ()=default
 Construct a new IComponentRType object. More...
 

Public Attributes

int _textureId
 
bool _toDelete = false
 
int _score = 0
 

Protected Attributes

Position _position
 
Size _size
 
Rect _rect
 
float _scale
 
bool hasChanged = false
 
std::vector< std::shared_ptr< Drawable > > _drawablesCollision
 
- Protected Attributes inherited from IComponentRType
char * _attribute
 

Detailed Description

Definition at line 21 of file Drawable.hpp.

Constructor & Destructor Documentation

◆ Drawable()

Drawable::Drawable ( )

Construct a new Drawable:: Drawable object.

Definition at line 16 of file Drawable.cpp.

References IComponentRType::_attribute, _textureId, setPosition(), setRect(), and setSize().

Here is the call graph for this function:

Member Function Documentation

◆ addDrawableCollision()

void Drawable::addDrawableCollision ( std::shared_ptr< Drawable drawableCollision)

addDrawableCollision, add a drawable collision

Parameters
drawableCollision

Definition at line 170 of file Drawable.cpp.

◆ getAttribute()

char * Drawable::getAttribute ( ) const
virtual

getAttribute, get the attribute

Returns
attribute (char *)

Implements IComponentRType.

Definition at line 30 of file Drawable.cpp.

References IComponentRType::_attribute.

◆ getDrawablesCollision()

std::vector< std::shared_ptr< Drawable > > Drawable::getDrawablesCollision ( ) const

getDrawablesCollision, get the drawables collision

Returns
drawablesCollision (std::vector<std::shared_ptr<Drawable>>)

Definition at line 179 of file Drawable.cpp.

◆ getHasChanged()

bool Drawable::getHasChanged ( ) const

getHasChanged, get if the drawable has changed

Returns
hasChanged (bool)

Definition at line 161 of file Drawable.cpp.

References hasChanged.

◆ getPacket()

std::shared_ptr< Packet > Drawable::getPacket ( )

getPacket, get the packet

Returns
packet (std::shared_ptr<Packet>)

Definition at line 125 of file Drawable.cpp.

References IComponentRType::_attribute, _textureId, drawable::attribute, drawable::attribute2, and drawable::id.

◆ getPosition()

std::tuple< float, float > Drawable::getPosition ( ) const

getPosition, get the position

setAttribute, set the attribute

Returns
position (std::tuple<float, float>)
Parameters
attribute(srd::tuple<float, float>)

Definition at line 51 of file Drawable.cpp.

◆ getRect()

std::tuple< int, int, int, int > Drawable::getRect ( ) const

getRect, get the rect

Returns
rect (std::tuple<int, int, int, int>)

Definition at line 106 of file Drawable.cpp.

◆ getScale()

float Drawable::getScale ( ) const

getScale, get the scale

Returns
scale (float)

Definition at line 79 of file Drawable.cpp.

References _scale.

◆ getSize()

std::tuple< float, float > Drawable::getSize ( ) const

getSize, get the size

Returns
size (std::tuple<float, float>)

Definition at line 70 of file Drawable.cpp.

◆ setAttribute()

void Drawable::setAttribute ( std::string  attribute)
virtual

setAttribute, set the attribute

Parameters
attribute

Implements IComponentRType.

Definition at line 39 of file Drawable.cpp.

References IComponentRType::_attribute, and hasChanged.

◆ setHasChanged()

void Drawable::setHasChanged ( bool  hasChanged)

setHasChanged, set if the drawable has changed

Parameters
hasChanged

Definition at line 152 of file Drawable.cpp.

References hasChanged.

◆ setPosition()

void Drawable::setPosition ( std::tuple< float, float >  position)

setPosition, set the position

Parameters
position

Definition at line 60 of file Drawable.cpp.

References hasChanged.

Referenced by Drawable().

Here is the caller graph for this function:

◆ setRect()

void Drawable::setRect ( std::tuple< int, int, int, int >  rect)

setRect, set the rect

Parameters
rect

Definition at line 115 of file Drawable.cpp.

References hasChanged.

Referenced by Drawable().

Here is the caller graph for this function:

◆ setScale()

void Drawable::setScale ( float  scale)

setScale, set the scale

Parameters
scale

Definition at line 97 of file Drawable.cpp.

References _scale.

◆ setSize()

void Drawable::setSize ( std::tuple< float, float >  size)

setSize, set the size

Parameters
size

Definition at line 88 of file Drawable.cpp.

References hasChanged.

Referenced by Drawable().

Here is the caller graph for this function:

Member Data Documentation

◆ _drawablesCollision

std::vector<std::shared_ptr<Drawable> > Drawable::_drawablesCollision
protected

Definition at line 153 of file Drawable.hpp.

◆ _position

Position Drawable::_position
protected

Definition at line 148 of file Drawable.hpp.

◆ _rect

Rect Drawable::_rect
protected

Definition at line 150 of file Drawable.hpp.

◆ _scale

float Drawable::_scale
protected

Definition at line 151 of file Drawable.hpp.

Referenced by getScale(), and setScale().

◆ _score

int Drawable::_score = 0

Definition at line 145 of file Drawable.hpp.

◆ _size

Size Drawable::_size
protected

Definition at line 149 of file Drawable.hpp.

◆ _textureId

int Drawable::_textureId

Definition at line 143 of file Drawable.hpp.

Referenced by Drawable(), and getPacket().

◆ _toDelete

bool Drawable::_toDelete = false

Definition at line 144 of file Drawable.hpp.

◆ hasChanged

bool Drawable::hasChanged = false
protected

Definition at line 152 of file Drawable.hpp.

Referenced by getHasChanged(), setAttribute(), setHasChanged(), setPosition(), setRect(), and setSize().


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