GEJM
1.0.0.0
a 2D platformer made by students
|
#include <Controller.h>
Public Member Functions | |
Controller (Creature *creature, double maxSpeed=1.0) | |
virtual | ~Controller () |
virtual void | control () |
Creature * | getCreature () |
ControllerState | getControllerState () |
Protected Member Functions | |
void | goLeft () |
void | goRight () |
void | stopGoing () |
Controller & | operator= (Controller const &)=delete |
Protected Attributes | |
Creature * | creature |
ControllerState | controllerState |
double const | maxSpeed |
Controller is a base class that can control a Creature. Default implementation move in one direction then change it after collision.
Controller::Controller | ( | Creature * | creature, |
double | maxSpeed = 1.0 |
||
) |
The default constructor with Creature possesion.
creature | association of Creature object |
maxSpeed | an absolute value of a maximum horizontal velocity that Controller should set |
Controller implementation The default constructor with Creature possesion.
creature | association of Creature object. |
maxSpeed | an absolute value of a maximum horizontal velocity that Controller should set. |
|
virtual |
The default destructor.
|
virtual |
A virtual implementation of how to control associated Creature.
Reimplemented in PlayerController.
ControllerState Controller::getControllerState | ( | ) |
Get current state of controller
Creature * Controller::getCreature | ( | ) |
|
protected |
|
protected |
|
protecteddelete |
Assignment operator is deleted because Controller has constant variable.
|
protected |
|
protected |
a protected ControllerState variable
|
protected |
an absolute value of a maximum horizontal velocity that Controller should set