C#Code
C#Code
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | Static Private Attributes
TheForum.GameCode.MessageSystems.GameMessageHandler Class Reference

List of all members.

Public Member Functions

 GameMessageHandler ()
bool RegisterForEvent (Libraries.StringType eventType, Libraries.Messaging.HandleMessageDelegate delegateToUse)
virtual void HandleKeyboardInputDelegate (object message)
virtual void HandleControllerInputDelegate (object message)
void RemoveAllChecks ()
void Update (int timePassed)
void AddGameMessage (GameMessage message)
 GameMessageHandler ()
bool RegisterForEvent (Libraries.StringType eventType, Libraries.Messaging.HandleMessageDelegate delegateToUse)
virtual void HandleKeyboardInputDelegate (object message)
void RemoveAllChecks ()
void Update (int timePassed)
void AddGameMessage (GameMessage message)

Static Public Attributes

static readonly
Libraries.StringType 
s_actionMoveHighlighterLeft = new Libraries.StringType("Highlighter_Left")
 Highlighter events. These are what you use when you register to check for actions that should happen to the piece highlighter/selector.
static readonly
Libraries.StringType 
s_actionMoveHighlighterRight = new Libraries.StringType("Highlighter_Right")
static readonly
Libraries.StringType 
s_actionMoveHighlighterUp = new Libraries.StringType("Highlighter_Up")
static readonly
Libraries.StringType 
s_actionMoveHighlighterDown = new Libraries.StringType("Highlighter_Down")
static readonly
Libraries.StringType 
s_actionMoveHighlighterSwap = new Libraries.StringType("Highlighter_Swap")
static readonly
Libraries.StringType 
s_actionMoveHighlighterSpeedUpMovement = new Libraries.StringType("Highlighter_SpeedUpMovement")
static readonly
Libraries.StringType 
s_actionSelectBoardSlot = new Libraries.StringType("Select_Game_Board_Slot")
 Select a board slot. Object type is Point which is the column and row of the board slot to select.
static readonly
Libraries.StringType 
s_actionUserPostMessage = new Libraries.StringType("User_Post_Message")
 Post the user message(pieces).
static readonly
Libraries.StringType 
s_actionUserRefreshPage = new Libraries.StringType("User_Refresh_Page")
 User hit refresh the thread. Should make the opponent post what it has. Speeds up posting.
static readonly
Libraries.StringType 
s_actionPostMessage = new Libraries.StringType("Post_Message")
 Player that receives the message is supposed to post.
static readonly
Libraries.StringType 
s_mouseSelectClick = new Libraries.StringType("Mouse_Select_Click")
 A mouse selection (left click) click occured. Object is a Point that is the screen location of the mouse click.
static readonly
Libraries.StringType 
s_postFormResultMessageID = new Libraries.StringType("Post_Form_Result_Message")
 A tax form was posted and here it the results.

Protected Member Functions

void AddKeyboardEventCheck (Keys keyType, Libraries.Input.ButtonState keyState, Libraries.StringType eventType, Libraries.Messaging.HandleMessageDelegate delegateToUse)
void AddControllerEventCheck (String keyType, Libraries.Input.ButtonState keyState, Libraries.StringType eventType, Libraries.Messaging.HandleMessageDelegate delegateToUse)
void AddKeyboardEventCheck (Keys keyType, Libraries.Messaging.KeyboardInputMessageHandler.KeyboardKeyState keyState, Libraries.StringType eventType, Libraries.Messaging.HandleMessageDelegate delegateToUse)

Protected Attributes

List< GameKeyboardEventCheckm_keyboardEventsToCheck = new List<GameKeyboardEventCheck>()
 Store all the keyboard events to handle.
List< GameControllerEventCheckm_controllerEventsToCheck = new List<GameControllerEventCheck>()
 Store all the controller events to handle.
List< GameEventCheckm_gameEventsToCheck = new List<GameEventCheck>()
 Check for a specific string type message. This is for messages stored in the m_gameMessages.
List< GameMessagem_gameMessages = new List<GameMessage>()
 Store the game messages that will be parceled out to people registered to get them.

Properties

static GameMessageHandler Instance [get]

Static Private Attributes

static GameMessageHandler m_instance
 Singleton instance.

Detailed Description

The message handler used to detect and store a game related actions that are triggered externally (like input). The game hooks into this and gets messages. The game should not directly get things like input, etc. That should all go through here. The manager will determine what triggers the event depending on the mode. If networking is being used, it could set highlighter messages to come from there instead of directly from input.


Constructor & Destructor Documentation

TheForum.GameCode.MessageSystems.GameMessageHandler.GameMessageHandler ( )

Default constructor.

TheForum.GameCode.MessageSystems.GameMessageHandler.GameMessageHandler ( )

Default constructor.


Member Function Documentation

void TheForum.GameCode.MessageSystems.GameMessageHandler.AddControllerEventCheck ( String  keyType,
Libraries.Input.ButtonState  keyState,
Libraries.StringType  eventType,
Libraries.Messaging.HandleMessageDelegate  delegateToUse 
) [protected]

Register a controller event.

keyType - Button press to check for.
keyState - Key state to check for with the key.
eventType - Type of the event.
delegateToUse - Delegate to run when the key state occurs.
void TheForum.GameCode.MessageSystems.GameMessageHandler.AddGameMessage ( GameMessage  message)

Store the given game message.

message - Message to store.
void TheForum.GameCode.MessageSystems.GameMessageHandler.AddGameMessage ( GameMessage  message)

Store the given game message.

message - Message to store.
void TheForum.GameCode.MessageSystems.GameMessageHandler.AddKeyboardEventCheck ( Keys  keyType,
Libraries.Input.ButtonState  keyState,
Libraries.StringType  eventType,
Libraries.Messaging.HandleMessageDelegate  delegateToUse 
) [protected]

Register a keyboard event.

keyType - Keypress to check for.
keyState - Key state to check for with the key.
eventType - Type of the event.
delegateToUse - Delegate to run when the key state occurs.
void TheForum.GameCode.MessageSystems.GameMessageHandler.AddKeyboardEventCheck ( Keys  keyType,
Libraries.Messaging.KeyboardInputMessageHandler.KeyboardKeyState  keyState,
Libraries.StringType  eventType,
Libraries.Messaging.HandleMessageDelegate  delegateToUse 
) [protected]

Register a keyboard event.

keyType - Keypress to check for.
keyState - Key state to check for with the key.
eventType - Type of the event.
delegateToUse - Delegate to run when the key state occurs.
virtual void TheForum.GameCode.MessageSystems.GameMessageHandler.HandleControllerInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type ControllerInputMessage.
virtual void TheForum.GameCode.MessageSystems.GameMessageHandler.HandleKeyboardInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type KeyboardInputMessage.
virtual void TheForum.GameCode.MessageSystems.GameMessageHandler.HandleKeyboardInputDelegate ( object  message) [virtual]

Used for a delegate to handle a input messages.

message - Message to handle. Should be of type KeyboardInputMessage.
bool TheForum.GameCode.MessageSystems.GameMessageHandler.RegisterForEvent ( Libraries.StringType  eventType,
Libraries.Messaging.HandleMessageDelegate  delegateToUse 
)

Register to be notified for the given event. Make sure to update this function for each new type of event.

eventType - Type of event to register for.
Return:
Value is true if the event registration was successful, false if not.
bool TheForum.GameCode.MessageSystems.GameMessageHandler.RegisterForEvent ( Libraries.StringType  eventType,
Libraries.Messaging.HandleMessageDelegate  delegateToUse 
)

Register to be notified for the given event. Make sure to update this function for each new type of event.

eventType - Type of event to register for.

Return:
Value is true if the event registration was successful, false if not.
void TheForum.GameCode.MessageSystems.GameMessageHandler.RemoveAllChecks ( )

Remove all event checks.

void TheForum.GameCode.MessageSystems.GameMessageHandler.RemoveAllChecks ( )

Remove all event checks and messages.

void TheForum.GameCode.MessageSystems.GameMessageHandler.Update ( int  timePassed)

Check stored messages and send them to anybody registered for them. Messages can be added while updating, but can't be removed till the update finishes.

timePassed - Time passed since the last update.
void TheForum.GameCode.MessageSystems.GameMessageHandler.Update ( int  timePassed)

Check stored messages and send them to anybody registered for them. Messages can be added while updating, but can't be removed till the update finishes.

timePassed - Time passed since the last update.

Member Data Documentation

Store all the controller events to handle.

Check for a specific string type message. This is for messages stored in the m_gameMessages.

Store the game messages that will be parceled out to people registered to get them.

Singleton instance.

Store all the keyboard events to handle.

static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionMoveHighlighterDown = new Libraries.StringType("Highlighter_Down") [static]
static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionMoveHighlighterLeft = new Libraries.StringType("Highlighter_Left") [static]

Highlighter events. These are what you use when you register to check for actions that should happen to the piece highlighter/selector.

static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionMoveHighlighterRight = new Libraries.StringType("Highlighter_Right") [static]
static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionMoveHighlighterSwap = new Libraries.StringType("Highlighter_Swap") [static]
static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionMoveHighlighterUp = new Libraries.StringType("Highlighter_Up") [static]
static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionPostMessage = new Libraries.StringType("Post_Message") [static]

Player that receives the message is supposed to post.

static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionSelectBoardSlot = new Libraries.StringType("Select_Game_Board_Slot") [static]

Select a board slot. Object type is Point which is the column and row of the board slot to select.

static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionUserPostMessage = new Libraries.StringType("User_Post_Message") [static]

Post the user message(pieces).

static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_actionUserRefreshPage = new Libraries.StringType("User_Refresh_Page") [static]

User hit refresh the thread. Should make the opponent post what it has. Speeds up posting.

static readonly Libraries StringType TheForum::GameCode::MessageSystems.GameMessageHandler::s_mouseSelectClick = new Libraries.StringType("Mouse_Select_Click") [static]

A mouse selection (left click) click occured. Object is a Point that is the screen location of the mouse click.

A tax form was posted and here it the results.


Property Documentation

static GameMessageHandler TheForum::GameCode::MessageSystems.GameMessageHandler::Instance [static, get]

Singleton instance of the class.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties