Creepy-simulation
 
Loading...
Searching...
No Matches
Steve Class Referencefinal

Represents an individual Steve unit in the simulation. More...

#include <Steve.hpp>

Inheritance diagram for Steve:
Unit

Public Member Functions

 Steve (const size_t id, const std::shared_ptr< StevesParams > &params)
 Constructs a Steve object.
 
void updateState (const std::shared_ptr< Unit > &another) override
 Updates the state of the Steve based on interaction with another unit.
 
void walk () override
 Executes the walking behavior of the Steve.
 
void die () override
 Executes the death behavior of the Steve.
 
decltype(state_) getState ()
 Retrieves the current state of the Steve.
 
- Public Member Functions inherited from Unit
 Unit (size_t id, const std::shared_ptr< UnitsParams > &params)
 Constructs a Unit object.
 
auto getCoord () const
 Retrieves the current coordinates of the unit.
 
auto getID () const
 Retrieves the ID of the unit.
 
virtual ~Unit ()=default
 Virtual destructor for Unit.
 
 Unit (const Unit &other)=default
 
Unitoperator= (const Unit &other)=default
 
 Unit (Unit &&other)=default
 
Unitoperator= (Unit &&other)=default
 

Additional Inherited Members

- Protected Member Functions inherited from Unit
void setID (const size_t id)
 Sets the ID of the unit.
 
void setCoord (const Point coord)
 Sets the coordinates of the unit.
 

Detailed Description

Represents an individual Steve unit in the simulation.

The Steve class manages the behavior, state, and interactions of a single Steve within the simulation.

Constructor & Destructor Documentation

◆ Steve()

Steve::Steve ( const size_t  id,
const std::shared_ptr< StevesParams > &  params 
)
inline

Constructs a Steve object.

Parameters
idUnique ID of the Steve.
paramsShared pointer to Steve parameters.

Member Function Documentation

◆ die()

void Steve::die ( )
overridevirtual

Executes the death behavior of the Steve.

Implements Unit.

◆ getState()

decltype(state_) Steve::getState ( )
inline

Retrieves the current state of the Steve.

Returns
The state of the Steve.

◆ updateState()

void Steve::updateState ( const std::shared_ptr< Unit > &  another)
overridevirtual

Updates the state of the Steve based on interaction with another unit.

Parameters
anotherShared pointer to another unit.

Implements Unit.

◆ walk()

void Steve::walk ( )
overridevirtual

Executes the walking behavior of the Steve.

Implements Unit.


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