Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DControllerInterface Class Referenceabstract

The U4DController interface provides the behaviors for the different type of controllers. More...

Inherited by U4DEngine::U4DGameController.

Public Member Functions

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

Detailed Description

The U4DController interface provides the behaviors for the different type of controllers.

Member Function Documentation

◆ getGameLogic()

virtual U4DGameLogicInterface* U4DEngine::U4DControllerInterface::getGameLogic ( )
pure 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

Implemented in U4DEngine::U4DGameController.

◆ getGameWorld()

virtual U4DWorld* U4DEngine::U4DControllerInterface::getGameWorld ( )
pure 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

Implemented in U4DEngine::U4DGameController.

◆ init()

virtual void U4DEngine::U4DControllerInterface::init ( )
pure virtual

initialization method

In the initialization method, controller entities such as buttons, joysticks, keyboards are created. callbacks are also created and linked

Implemented in U4DEngine::U4DGamepadController, U4DEngine::U4DKeyboardController, and U4DEngine::U4DTouchesController.

◆ sendUserInputUpdate()

virtual void U4DEngine::U4DControllerInterface::sendUserInputUpdate ( void *  uData)
pure 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

Implemented in U4DEngine::U4DGameController.

◆ setGameLogic()

virtual void U4DEngine::U4DControllerInterface::setGameLogic ( U4DGameLogicInterface uGameLogic)
pure virtual

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

The Model component refers to the U4DGameLogic object.

Parameters
uGameLogicthe U4DGameLogic object

Implemented in U4DEngine::U4DGameController.

◆ setGameWorld()

virtual void U4DEngine::U4DControllerInterface::setGameWorld ( U4DWorld uGameWorld)
pure 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

Implemented in U4DEngine::U4DGameController.

◆ setReceivedAction()

virtual void U4DEngine::U4DControllerInterface::setReceivedAction ( bool  uValue)
pure 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.

Implemented in U4DEngine::U4DGameController.