GEJM  1.0.0.0
a 2D platformer made by students
Public Member Functions | List of all members
PlayerController Class Reference

#include <PlayerController.h>

Inheritance diagram for PlayerController:
Controller

Public Member Functions

 PlayerController (PlayerCreature *creature)
 
 ~PlayerController ()
 
void jump ()
 
void control () override
 
PlayerControlleroperator= (PlayerController const &)=delete
 
- Public Member Functions inherited from Controller
 Controller (Creature *creature, double maxSpeed=1.0)
 
virtual ~Controller ()
 
CreaturegetCreature ()
 
ControllerState getControllerState ()
 

Additional Inherited Members

- Protected Member Functions inherited from Controller
void goLeft ()
 
void goRight ()
 
void stopGoing ()
 
Controlleroperator= (Controller const &)=delete
 
- Protected Attributes inherited from Controller
Creaturecreature
 
ControllerState controllerState
 
double const maxSpeed
 

Detailed Description

PlayerController is a special Controller that takes interprets player input.

Constructor & Destructor Documentation

PlayerController::PlayerController ( PlayerCreature creature)

The default constructor with PlayerCreature possesion.

Parameters
creatureassociation of Creature object
maxSpeedan absolute value of a maximum horizontal velocity that PlayerController should set
See also
PlayerCreature
Controller

PlayerController implementation The default constructor with PlayerCreature possesion.

Parameters
creatureassociation of Creature object
maxSpeedan absolute value of a maximum horizontal velocity that PlayerController should set
See also
PlayerCreature
Controller
PlayerController::~PlayerController ( )

The default destructor.

Member Function Documentation

void PlayerController::control ( )
overridevirtual

An implementation of how to control associated PlayerCreature.

See also
PlayerCreature
Controller
jump()
Returns
void

Reimplemented from Controller.

void PlayerController::jump ( )

Tell controlled PlayerCreature to jump.

Returns
void
PlayerController& PlayerController::operator= ( PlayerController const &  )
delete

Assignment operator is deleted because PlayerController has constant variable.


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