Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DGameController Class Reference

Inherits U4DEngine::U4DControllerInterface.

Inherited by U4DEngine::U4DGamepadController, U4DEngine::U4DKeyboardController, and U4DEngine::U4DTouchesController.

Public Member Functions

virtual void init ()
 
void update (double dt)
 
void registerInputEntity (U4DInputElement *uInputElement)
 
void removeInputEntity (U4DInputElement *uInputElement)
 
void notifyInputEntity ()
 
void changeState (INPUTELEMENTTYPE uInputElementType, INPUTELEMENTACTION uInputAction, U4DVector2n &uPosition)
 
void setGameWorld (U4DWorld *uGameWorld)
 Sets the current view component of the game. More...
 
void setGameLogic (U4DGameLogicInterface *uGameLogic)
 Sets the current Model component (MVC) of the game. More...
 
U4DWorldgetGameWorld ()
 Gets the current U4DWorld entity linked to the controller. More...
 
U4DGameLogicInterfacegetGameLogic ()
 Gets the current U4DGameLogic object linked to the controller. More...
 
void sendUserInputUpdate (void *uData)
 Sends user input to the linked U4DGameLogic. More...
 
void setReceivedAction (bool uValue)
 Indicates that an action on the controller has been received. More...
 
virtual void getUserInputData (unichar uCharacter, INPUTELEMENTACTION uInputAction)
 
void getUserInputData (INPUTELEMENTTYPE uInputElement, INPUTELEMENTACTION uInputAction, U4DVector2n &uPosition)
 
void getUserInputData (INPUTELEMENTTYPE uInputElement, INPUTELEMENTACTION uInputAction)
 
virtual void getUserInputData (GCExtendedGamepad *gamepad, GCControllerElement *element)
 
- Public Member Functions inherited from U4DEngine::U4DControllerInterface
virtual ~U4DControllerInterface ()
 Virtual destructor for interface. The actual destructor implementation is set by the subclasses.
 

Protected Attributes

U4DWorldgameWorld
 The view component (mvc) linked to the controller. More...
 
U4DGameLogicInterfacegameLogic
 the model component (mvc) linked to the controller More...
 
bool receivedAction
 variable to determine if an action was received
 

Member Function Documentation

◆ getGameLogic()

U4DGameLogicInterface * U4DEngine::U4DGameController::getGameLogic ( )
virtual

Gets the current U4DGameLogic object linked to the controller.

The U4DGameLogic refers to the model component of the MVC

Returns
The current Game Model. i.e. game logic

Implements U4DEngine::U4DControllerInterface.

◆ getGameWorld()

U4DWorld * U4DEngine::U4DGameController::getGameWorld ( )
virtual

Gets the current U4DWorld entity linked to the controller.

The U4DWorld entity refers to the view component of the MVC

Returns
The current game world. i.e. view component

Implements U4DEngine::U4DControllerInterface.

◆ sendUserInputUpdate()

void U4DEngine::U4DGameController::sendUserInputUpdate ( void *  uData)
virtual

Sends user input to the linked U4DGameLogic.

The controller sends the user input information to the U4DGameLogic

Parameters
uDatadata containing the informationation about the user input

Implements U4DEngine::U4DControllerInterface.

◆ setGameLogic()

void U4DEngine::U4DGameController::setGameLogic ( U4DGameLogicInterface uGameLogic)
virtual

Sets the current Model component (MVC) of the game.

The Model component referst to the U4DGameLogic object.

Parameters
uGameLogicthe U4DGameLogic object

Implements U4DEngine::U4DControllerInterface.

◆ setGameWorld()

void U4DEngine::U4DGameController::setGameWorld ( U4DWorld uGameWorld)
virtual

Sets the current view component of the game.

The view component (MVC) refers to the U4DWorld entity used in the game

Parameters
uGameWorldthe U4DWorld entity

Implements U4DEngine::U4DControllerInterface.

◆ setReceivedAction()

void U4DEngine::U4DGameController::setReceivedAction ( bool  uValue)
virtual

Indicates that an action on the controller has been received.

Gets set Whenever there is an action on the controller such as a press, release, movement.

Parameters
uValuetrue for action has been detected.

Implements U4DEngine::U4DControllerInterface.

Member Data Documentation

◆ gameLogic

U4DGameLogicInterface* U4DEngine::U4DGameController::gameLogic
protected

the model component (mvc) linked to the controller

The Model component refers to the U4DGameLogic object.

◆ gameWorld

U4DWorld* U4DEngine::U4DGameController::gameWorld
protected

The view component (mvc) linked to the controller.

The view component (MVC) refers to the U4DWorld entity used in the game