class
cCellModeStrategy
Base classes
- class IGameMode
- An interface that represents a mode in the game, that can receive mouse/keyboard input and update every frame.
- class IUnmanagedMessageListener
- Same as App::
IMessageListener, but this one does not use ref-counting.
Public static variables
Public functions
- auto AddRef() -> int override
- Increases the reference count and returns it.
- auto Release() -> int override
- Decreases the reference count and returns it.
- auto func0Ch() -> bool override
-
auto Initialize(App::
IGameModeManager* pManager) -> bool override - This method is called once on every game mode when all modes have been added.
- auto Dispose() -> bool override
- This method is called once on every game mode when the game closes.
- auto OnEnter() -> bool override
- This method is called when the game mode is set as active, and therefore, entered.
- auto OnExit() -> void override
- This method is called when a different game mode is set as active, and therefore, this game mode is exited (no longer active).
- auto func20h(int) -> void* override
- auto OnKeyDown(int virtualKey, KeyModifiers modifiers) -> bool override
- An event listener called every time a key is pressed while this mode is active.
- auto OnKeyUp(int virtualKey, KeyModifiers modifiers) -> bool override
- An event listener called every time a key is released while this mode is active.
- auto OnMouseDown(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool override
- An event listener called every time a mouse key is pressed while this mode is active.
- auto OnMouseUp(MouseButton mouseButton, float mouseX, float mouseY, MouseState mouseState) -> bool override
- An event listener called every time a mouse key is released while this mode is active.
- auto OnMouseMove(float mouseX, float mouseY, MouseState mouseState) -> bool override
- An event listener called every time the mouse is moved while this mode is active.
- auto OnMouseWheel(int wheelDelta, float mouseX, float mouseY, MouseState mouseState) -> bool override
- An event listener called every time the mouse wheel is moved while this mode is active.
- auto Update(float delta1, float delta2) -> void override
- An event listener called every game loop.
-
auto HandleMessage(uint32_
t messageID, void* msg) -> bool override - Called every time a message is received.
Public variables
Function documentation
bool App:: cCellModeStrategy:: Initialize(App:: IGameModeManager* pManager) override
This method is called once on every game mode when all modes have been added.
Parameters | |
---|---|
pManager | The GameModeManager that has called this method. |
This should take care of all initializations and setups that are required.
bool App:: cCellModeStrategy:: OnKeyDown(int virtualKey,
KeyModifiers modifiers) override
An event listener called every time a key is pressed while this mode is active.
Parameters | |
---|---|
virtualKey | The VK code of the key. |
modifiers | The modifiers (Ctrl, Alt and Shift) currently being pressed. They use the enum values UTFWin::kModifier.... |
Returns | Whether the event was handled or not. |
bool App:: cCellModeStrategy:: OnKeyUp(int virtualKey,
KeyModifiers modifiers) override
An event listener called every time a key is released while this mode is active.
Parameters | |
---|---|
virtualKey | The VK code of the key. |
modifiers | The modifiers (Ctrl, Alt and Shift) currently being pressed. They use the enum values UTFWin::kModifier.... |
Returns | Whether the event was handled or not. |
bool App:: cCellModeStrategy:: OnMouseDown(MouseButton mouseButton,
float mouseX,
float mouseY,
MouseState mouseState) override
An event listener called every time a mouse key is pressed while this mode is active.
Parameters | |
---|---|
mouseButton | The button that was pressed. |
mouseX | The X position of the mouse. |
mouseY | The Y position of the mouse. |
mouseState | The state of the mouse. |
Returns | Whether the event was handled or not. |
bool App:: cCellModeStrategy:: OnMouseUp(MouseButton mouseButton,
float mouseX,
float mouseY,
MouseState mouseState) override
An event listener called every time a mouse key is released while this mode is active.
Parameters | |
---|---|
mouseButton | The button that was released. |
mouseX | The X position of the mouse. |
mouseY | The Y position of the mouse. |
mouseState | The state of the mouse. |
Returns | Whether the event was handled or not. |
bool App:: cCellModeStrategy:: OnMouseMove(float mouseX,
float mouseY,
MouseState mouseState) override
An event listener called every time the mouse is moved while this mode is active.
Parameters | |
---|---|
mouseX | The X position of the mouse. |
mouseY | The Y position of the mouse. |
mouseState | The state of the mouse. |
Returns | Whether the event was handled or not. |
bool App:: cCellModeStrategy:: OnMouseWheel(int wheelDelta,
float mouseX,
float mouseY,
MouseState mouseState) override
An event listener called every time the mouse wheel is moved while this mode is active.
Parameters | |
---|---|
wheelDelta | The amount of units the wheel moved. This is a multiple of UTFWin::kMouseWheelDelta. |
mouseX | The X position of the mouse. |
mouseY | The Y position of the mouse. |
mouseState | The state of the mouse. |
Returns | Whether the event was handled or not. |
bool App:: cCellModeStrategy:: HandleMessage(uint32_ t messageID,
void* msg) override
Called every time a message is received.
Parameters | |
---|---|
messageID | The ID of the message received. |
msg | The data of the message received, it might be nullptr. |
Returns | Whether the message was handled or not. |
Only the messages with an ID this listener signed up for will call this event.