1 #ifndef ENTITY_DECORATOR_H_
2 #define ENTITY_DECORATOR_H_
8 template <std::derived_from<IEntity> T = IEntity>
37 return sub->linkModel(model);
44 virtual int getId()
const {
return sub->getId(); }
68 virtual std::string
getColor()
const {
return sub->getColor(); }
74 virtual std::string
getName()
const {
return sub->getName(); }
80 virtual double getSpeed()
const {
return sub->getSpeed(); }
98 virtual void setColor(std::string col_) {
return sub->setColor(col_); }
104 virtual void rotate(
double angle) {
return sub->rotate(angle); }
110 virtual void update(
double dt) {
return sub->update(dt); }
Base class decorator for all entities that implements each specific entity in a template,...
Definition: IEntityDecorator.h:15
virtual const JsonObject & getDetails() const
Gets the details of the entity.
Definition: IEntityDecorator.h:62
IEntityDecorator(T *e)
Constructor for IEntityDecorator.
Definition: IEntityDecorator.h:21
virtual void linkModel(SimulationModel *model)
Links this entity to a simulation model, giving it access to the model's public variables and functio...
Definition: IEntityDecorator.h:36
virtual ~IEntityDecorator()
Destructor.
Definition: IEntityDecorator.h:26
virtual Vector3 getDirection() const
Gets the direction of the entity.
Definition: IEntityDecorator.h:56
virtual std::string getColor() const
Gets the color of the entity.
Definition: IEntityDecorator.h:68
virtual Vector3 getPosition() const
Gets the position of the entity.
Definition: IEntityDecorator.h:50
virtual void rotate(double angle)
Rotate the entity around y axis.
Definition: IEntityDecorator.h:104
virtual double getSpeed() const
Gets the speed of the entity.
Definition: IEntityDecorator.h:80
virtual int getId() const
Gets the ID of the entity.
Definition: IEntityDecorator.h:44
virtual std::string getName() const
Gets the name of the entity.
Definition: IEntityDecorator.h:74
virtual void setPosition(Vector3 pos_)
Sets the position of the entity.
Definition: IEntityDecorator.h:86
virtual void setDirection(Vector3 dir_)
Set the direction of the entity.
Definition: IEntityDecorator.h:92
virtual void update(double dt)
Updates the entity's position in the physical system.
Definition: IEntityDecorator.h:110
virtual void setColor(std::string col_)
Sets the color of the entity.
Definition: IEntityDecorator.h:98
Manages a picojson::object, works with JsonValue to provide implicit casting.
Class SimulationModel handling the transit simulation. it can communicate with the controller.
Definition: SimulationModel.h:30
a simple class used for vector math, most function are self explanatory
Definition: vector3.h:12