Arcade architecture
IEntity Class Referenceabstract

Abstract interface for entities. More...

#include <IEntity.hpp>

Public Member Functions

 IEntity ()=default
 Default constructor for IEntity.
 
 ~IEntity ()=default
 Default destructor for IEntity.
 
virtual void onClick ()=0
 Handles the click event on the entity. More...
 
virtual void moveEntity ()=0
 Moves the entity. More...
 
virtual void onInteract ()=0
 Handles interaction with the entity. More...
 
virtual std::pair< size_t, size_t > getPosition () const =0
 Gets the position of the entity. More...
 
virtual void setPosition (std::pair< size_t, size_t > position)=0
 Sets the position of the entity. More...
 
virtual std::pair< size_t, size_t > getSize () const =0
 Gets the size of the entity. More...
 
virtual std::string getSpriteName () const =0
 Gets the sprite name of the entity. More...
 
virtual std::size_t getColor () const =0
 Gets the color of the entity. More...
 
virtual std::size_t getZIndex () const =0
 Gets the z-index of the entity. More...
 
virtual bool isMovable () const =0
 Checks if the entity is movable. More...
 

Detailed Description

Abstract interface for entities.

The IEntity interface defines the basic structure and behavior of an entity. It includes methods for handling interactions, movement, and retrieving or setting entity properties such as position, size, and appearance.

Member Function Documentation

◆ getColor()

virtual std::size_t IEntity::getColor ( ) const
pure virtual

Gets the color of the entity.

Returns
A size_t representing the color of the entity.

◆ getPosition()

virtual std::pair< size_t, size_t > IEntity::getPosition ( ) const
pure virtual

Gets the position of the entity.

Returns
A pair of size_t representing the x and y coordinates of the entity.

◆ getSize()

virtual std::pair< size_t, size_t > IEntity::getSize ( ) const
pure virtual

Gets the size of the entity.

Returns
A pair of size_t representing the width and height of the entity.

◆ getSpriteName()

virtual std::string IEntity::getSpriteName ( ) const
pure virtual

Gets the sprite name of the entity.

Returns
A string representing the name of the sprite associated with the entity.

◆ getZIndex()

virtual std::size_t IEntity::getZIndex ( ) const
pure virtual

Gets the z-index of the entity.

Returns
A size_t representing the z-index of the entity, which determines its rendering order relative to other entities.

◆ isMovable()

virtual bool IEntity::isMovable ( ) const
pure virtual

Checks if the entity is movable.

Returns
A boolean value indicating whether the entity can be moved.

◆ moveEntity()

virtual void IEntity::moveEntity ( )
pure virtual

Moves the entity.

This method is responsible for updating the entity's position based on its movement logic.

◆ onClick()

virtual void IEntity::onClick ( )
pure virtual

Handles the click event on the entity.

This method is called when the entity is clicked.

◆ onInteract()

virtual void IEntity::onInteract ( )
pure virtual

Handles interaction with the entity.

This method is called when the entity is interacted with.

◆ setPosition()

virtual void IEntity::setPosition ( std::pair< size_t, size_t >  position)
pure virtual

Sets the position of the entity.

Parameters
positionA pair of size_t representing the new x and y coordinates.

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