CSCI3081W Drone Delivery System
Public Member Functions | List of all members
SpinDecorator 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 <SpinDecorator.h>

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

Public Member Functions

 SpinDecorator (IStrategy *strategy, double time=4, double spinSpeed=1)
 Construct a new Spin Decorator object. More...
 
void celebrate (IEntity *entity, double dt)
 Move the entity with the spin behavior for 4 seconds. 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

◆ SpinDecorator()

SpinDecorator::SpinDecorator ( IStrategy strategy,
double  time = 4,
double  spinSpeed = 1 
)

Construct a new Spin Decorator object.

Parameters
[in]strategythe strategy to decorate onto
[in]timehow long to celebrate
[in]spinSpeedmultiplier for how fast to spin

Member Function Documentation

◆ celebrate()

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

Move the entity with the spin behavior for 4 seconds.

Parameters
entityEntity to move
dtDelta Time

Implements ICelebrationDecorator.


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