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

#include <Pattern.hpp>

Inheritance diagram for ECS::Pattern:
ECS::IComp

Public Member Functions

 Pattern (int sizeMapX, int sizeMapY, int sizeEntityX, int sizeEntityY, PatternType type=STRAIGHT) noexcept
 
 Pattern (const Pattern &pattern) noexcept=default
 
 Pattern (Pattern &&) noexcept=delete
 
 ~Pattern () noexcept override=default
 
void changePatternType (PatternType pattern) noexcept
 
std::pair< int, int > getFirstPosition () noexcept
 
void getNextPosition (std::shared_ptr< ECS::Acceleration > acc, std::shared_ptr< ECS::Speed > speed, std::shared_ptr< ECS::Position > pos) noexcept
 
Patternoperator= (const Pattern &) const noexcept=delete
 
Patternoperator= (Pattern &&) const noexcept=delete
 
- Public Member Functions inherited from ECS::IComp
virtual ~IComp () noexcept=default
 

Constructor & Destructor Documentation

◆ Pattern() [1/3]

ECS::Pattern::Pattern ( int  sizeMapX,
int  sizeMapY,
int  sizeEntityX,
int  sizeEntityY,
PatternType  type = STRAIGHT 
)
explicitnoexcept

It initializes the pattern of the enemy.

Parameters
sizeMapXthe width of the map
sizeMapYthe height of the map
sizeEntityXthe width of the entity
sizeEntityYThe height of the entity
typeThe type of pattern the enemy will follow.

◆ Pattern() [2/3]

ECS::Pattern::Pattern ( const Pattern pattern)
defaultnoexcept

◆ Pattern() [3/3]

ECS::Pattern::Pattern ( Pattern &&  )
explicitdeletenoexcept

◆ ~Pattern()

ECS::Pattern::~Pattern ( )
overridedefaultnoexcept

Member Function Documentation

◆ changePatternType()

void ECS::Pattern::changePatternType ( PatternType  type)
noexcept

It changes the pattern of the enemy

Parameters
typeThe type of pattern to use.

◆ getFirstPosition()

std::pair< int, int > ECS::Pattern::getFirstPosition ( )
noexcept

It returns the first position of the pattern

Returns
The first position of the pattern.

◆ getNextPosition()

void ECS::Pattern::getNextPosition ( std::shared_ptr< ECS::Acceleration acceleration,
std::shared_ptr< ECS::Speed speed,
std::shared_ptr< ECS::Position pos 
)
noexcept

It returns the next position of the entity according to the pattern

Parameters
speedthe speed of the entity
posthe position of the entity
Returns
A pair of int

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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