CSCI3081W Drone Delivery System
Public Member Functions | List of all members
JumpDecorator Class Reference

this class inhertis from the IStrategy class and is represents a celebration decorator where the entity will celebrate according to it. More...

#include <JumpDecorator.h>

Inheritance diagram for JumpDecorator:
Inheritance graph
[legend]
Collaboration diagram for JumpDecorator:
Collaboration graph
[legend]

Public Member Functions

 JumpDecorator (IStrategy *strategy, double time=4, double jumpHeight=10)
 Construct a new Jump Decorator object. More...
 
void celebrate (IEntity *entity, double dt)
 Make the entity celebrate with the jump behavior. More...
 
- Public Member Functions inherited from ICelebrationDecorator
 ICelebrationDecorator (IStrategy *strategy, double time=4)
 Construct a new Celebration Decorator object. More...
 
virtual ~ICelebrationDecorator ()
 Celebration Destructor.
 
virtual void move (IEntity *entity, double dt)
 Move the entity with the behavior as described for 4 seconds. More...
 
virtual bool isCompleted ()
 Check if the movement is completed by checking the time. More...
 
double currentPathDistance (Vector3 startPosition)
 Get the current distance of the entire path starting from startPosition and the current index. More...
 
double totalPathDistance (Vector3 startPosition)
 Get the total distance of the entire path starting from startPosition and index 0. More...
 
- Public Member Functions inherited from IStrategy
virtual ~IStrategy ()
 Destructor.
 

Additional Inherited Members

- Protected Attributes inherited from ICelebrationDecorator
IStrategystrategy = nullptr
 
float time = 0
 

Detailed Description

this class inhertis from the IStrategy class and is represents a celebration decorator where the entity will celebrate according to it.

Constructor & Destructor Documentation

◆ JumpDecorator()

JumpDecorator::JumpDecorator ( IStrategy strategy,
double  time = 4,
double  jumpHeight = 10 
)

Construct a new Jump Decorator object.

Parameters
[in]strategythe strategy to decorate onto
[in]timehow long to celebrate
[in]jumpHeighthow far up to jump

Member Function Documentation

◆ celebrate()

void JumpDecorator::celebrate ( IEntity entity,
double  dt 
)
virtual

Make the entity celebrate with the jump behavior.

Parameters
entityEntity to celebrate
dtDelta Time

Implements ICelebrationDecorator.


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