R-TYPE
Public Member Functions | List of all members
ECS::Position Class Reference

#include <Position.hpp>

Inheritance diagram for ECS::Position:
ECS::IComp

Public Member Functions

 Position (short x, short y) noexcept
 
 Position (const Position &pos) noexcept
 
 Position (Position &&) noexcept=delete
 
 ~Position () noexcept override=default
 
Positionoperator= (const Position &) const noexcept=delete
 
Positionoperator= (Position &&) const noexcept=delete
 
short getPosition_x () const noexcept
 
short getPosition_y () const noexcept
 
void setPosition_x (short x) noexcept
 
void setPosition_y (short y) noexcept
 
- Public Member Functions inherited from ECS::IComp
virtual ~IComp () noexcept=default
 

Constructor & Destructor Documentation

◆ Position() [1/3]

ECS::Position::Position ( short  x,
short  y 
)
explicitnoexcept

Constructor for the Position component, which takes two short integers as parameters and assigns them to the _x and _y member variables.

Parameters
xThe x coordinate of the position.
yThe y coordinate of the position.

◆ Position() [2/3]

ECS::Position::Position ( const Position pos)
noexcept

Copy constructor

Parameters
posThe position to copy.

◆ Position() [3/3]

ECS::Position::Position ( Position &&  )
explicitdeletenoexcept

◆ ~Position()

ECS::Position::~Position ( )
overridedefaultnoexcept

Member Function Documentation

◆ getPosition_x()

short ECS::Position::getPosition_x ( ) const
noexcept

It returns the value of the private variable _x.

Returns
A constant reference to the private member variable _x.

◆ getPosition_y()

short ECS::Position::getPosition_y ( ) const
noexcept

It returns the value of the private variable _y.

Returns
A reference to the position_x variable.

◆ operator=() [1/2]

Position& ECS::Position::operator= ( const Position ) const
deletenoexcept

◆ operator=() [2/2]

Position& ECS::Position::operator= ( Position &&  ) const
deletenoexcept

◆ setPosition_x()

void ECS::Position::setPosition_x ( short  x)
noexcept

Sets the x position of the entity.

Parameters
xThe x position of the entity.

◆ setPosition_y()

void ECS::Position::setPosition_y ( short  y)
noexcept

This function sets the y position of the entity.

Parameters
yThe y position of the entity.

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