#include <State.h>
Inheritance diagram for State:


Public Member Functions | |
| State () | |
| State (StateID state) | |
| virtual | ~State () |
| virtual void | paint () |
| Callback for painting, overload in other states. | |
| virtual void | doKey (int key, int x, int y, bool special, bool down, unsigned int modifiers) |
| Callback for key event, overload in other states. | |
| virtual void | doMouseDown (Interface::MouseButtonType button, int x, int y) |
| Callback for mouse down, overload in other states. | |
| virtual void | doMouseUp (Interface::MouseButtonType button, int x, int y) |
| Callback for mouse up, overload in other states. | |
| virtual void | doMouseDragged (int x, int y) |
| Callback for mouse dragged, overload in other states. | |
Static Public Member Functions | |
| static void | SetState (StateID state) |
| Switch state. | |
| static void | Destroy () |
| Cleans up any resources used by states such as deleting the current state and current gamestate. | |
| static void | DoRepaint () |
| Calls currentState->paint and flushes the current inteface. | |
| static void | DoKey (int key, int x, int y, bool special, bool down, unsigned int modifiers) |
| Calls currentState->doKey. | |
| static void | DoMouseDragged (int x, int y) |
| Calls currentState->doMouseDragged. | |
| static void | DoMouse (int x, int y, Interface::MouseButtonType button, bool down) |
| Calls currentState->doMouseUp/doMouseDown. | |
| static void | DoAnimateOneFrame (int value) |
| Periodic call to paint and flush. | |
| static void | SynchronizePreferences (int ignore) |
| Timer callback to synchronize preferences with disc. | |
Protected Attributes | |
| StateID | ID |
| bool | stopIntro |
Static Protected Attributes | |
| static State * | currentState |
Changes how the application handles events depending on the current state. Simple states can be incorporated to the State class, but for more complex states a sub-class should be created to provide encapsulation.
Often static functions can be reused by having them call member functions in the current state.
| State::State | ( | ) | [inline] |
| State::State | ( | StateID | state | ) |
| virtual State::~State | ( | ) | [virtual] |
| static void State::Destroy | ( | ) | [static] |
Cleans up any resources used by states such as deleting the current state and current gamestate.
| static void State::DoAnimateOneFrame | ( | int | value | ) | [static] |
Periodic call to paint and flush.
| static void State::DoKey | ( | int | key, | |
| int | x, | |||
| int | y, | |||
| bool | special, | |||
| bool | down, | |||
| unsigned int | modifiers | |||
| ) | [static] |
Calls currentState->doKey.
| virtual void State::doKey | ( | int | key, | |
| int | x, | |||
| int | y, | |||
| bool | special, | |||
| bool | down, | |||
| unsigned int | modifiers | |||
| ) | [virtual] |
| static void State::DoMouse | ( | int | x, | |
| int | y, | |||
| Interface::MouseButtonType | button, | |||
| bool | down | |||
| ) | [static] |
Calls currentState->doMouseUp/doMouseDown.
| virtual void State::doMouseDown | ( | Interface::MouseButtonType | button, | |
| int | x, | |||
| int | y | |||
| ) | [inline, virtual] |
| static void State::DoMouseDragged | ( | int | x, | |
| int | y | |||
| ) | [static] |
Calls currentState->doMouseDragged.
| virtual void State::doMouseDragged | ( | int | x, | |
| int | y | |||
| ) | [inline, virtual] |
| virtual void State::doMouseUp | ( | Interface::MouseButtonType | button, | |
| int | x, | |||
| int | y | |||
| ) | [inline, virtual] |
| static void State::DoRepaint | ( | ) | [static] |
Calls currentState->paint and flushes the current inteface.
| virtual void State::paint | ( | ) | [virtual] |
| static void State::SetState | ( | StateID | state | ) | [static] |
Switch state.
| static void State::SynchronizePreferences | ( | int | ignore | ) | [static] |
Timer callback to synchronize preferences with disc.
State* State::currentState [static, protected] |
bool State::stopIntro [protected] |
1.4.7