C# Class Ballz.Input.InputTranslator

Input translator takes care of all physical inputs with regards to specified keymappings etc. It translates these inputs to corresponding Game Messages.
Inheritance: Microsoft.Xna.Framework.GameComponent
Datei anzeigen Open project: SpagAachen/Ballz Class Usage Examples

Public Methods

Method Description
InjectInputMessage ( InputMessage message, Player player ) : void
InputTranslator ( Ballz game ) : System
Update ( GameTime gameTime ) : void

Private Methods

Method Description
ChangedKeys ( Keys a, Keys b ) : List

find out which keys got changed from array a to array b. the comparison is one sided thus if in b a key was added the returned list will be empty. if in a a key was added, the list will contain this key

EmitKeyMessages ( List keyList, bool pressed ) : void
OnInput ( InputMessage inputType, bool pressed = false, char key = char.MinValue, Player player = null ) : void
ProcessGamePadInput ( int p ) : void
ProcessInput ( ) : void
ProcessRawInput ( ) : void

Processes the raw input and emits corresponding Events. TODO: add GamePad Support for raw inputs.

RawHandler ( object sender, Microsoft.Xna.Framework.TextInputEventArgs eventArgs ) : void

Method Details

InjectInputMessage() public method

public InjectInputMessage ( InputMessage message, Player player ) : void
message Ballz.Messages.InputMessage
player Ballz.GameSession.Logic.Player
return void

InputTranslator() public method

public InputTranslator ( Ballz game ) : System
game Ballz
return System

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void