C# Class SmashBros.Controllers.GamepadController

The gamepad controller uses the gamestate to determine which controllers to use
Inheritance: Controller
Show file Open project: Grutn/TDT4240-X2 Class Usage Examples

Public Properties

Property Type Description
OnBackPress ButtonPressed
OnHitKeyPressed ButtonPressed
OnHitKeyUp ButtonUp
OnHitkeyDown ButtonDown
OnNavigation NavigationKey
OnShieldKeyPressed ButtonPressed
OnShieldKeyUp ButtonUp
OnShieldkeyDown ButtonDown
OnStartPress ButtonPressed
OnSuperKeyPressed ButtonPressed
OnSuperKeyUp ButtonUp
OnSuperkeyDown ButtonDown

Public Methods

Method Description
Deactivate ( ) : void
GamepadController ( ScreenManager screen, Player playerModel ) : System
Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
OnNext ( GameStateManager value ) : void
Unload ( ) : void
Update ( GameTime gameTime ) : void

Protected Methods

Method Description
IsKeyDown ( Keys key ) : bool
IsKeyPressed ( Keys key ) : bool

Checks the old keyboard state agianst the current keyboard state to determin if a key was pressed

IsKeyPressedReversed ( Keys key ) : bool
IsKeyUp ( Keys key ) : bool

Private Methods

Method Description
UpdateTimer ( Keys key, Buttons button, float directionX, float directionY, float elapsedTime, ButtonDown downAction, ButtonUp upAction, ButtonPressed pressAction, float &downTimer, float &upTimer ) : void
UpdateTimers ( GameTime gameTime ) : void
isControllerPressed ( Buttons button ) : bool
updateNavigation ( ) : void

Method Details

Deactivate() public method

public Deactivate ( ) : void
return void

GamepadController() public method

public GamepadController ( ScreenManager screen, Player playerModel ) : System
screen SmashBros.MySystem.ScreenManager
playerModel Player
return System

IsKeyDown() protected method

protected IsKeyDown ( Keys key ) : bool
key Keys
return bool

IsKeyPressed() protected method

Checks the old keyboard state agianst the current keyboard state to determin if a key was pressed
protected IsKeyPressed ( Keys key ) : bool
key Keys Which key was pressed
return bool

IsKeyPressedReversed() protected method

protected IsKeyPressedReversed ( Keys key ) : bool
key Keys
return bool

IsKeyUp() protected method

protected IsKeyUp ( Keys key ) : bool
key Keys
return bool

Load() public method

public Load ( Microsoft.Xna.Framework.Content.ContentManager content ) : void
content Microsoft.Xna.Framework.Content.ContentManager
return void

OnNext() public method

public OnNext ( GameStateManager value ) : void
value GameStateManager
return void

Unload() public method

public Unload ( ) : void
return void

Update() public method

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

Property Details

OnBackPress public property

public ButtonPressed OnBackPress
return ButtonPressed

OnHitKeyPressed public property

public ButtonPressed OnHitKeyPressed
return ButtonPressed

OnHitKeyUp public property

public ButtonUp OnHitKeyUp
return ButtonUp

OnHitkeyDown public property

public ButtonDown OnHitkeyDown
return ButtonDown

OnNavigation public property

public NavigationKey OnNavigation
return NavigationKey

OnShieldKeyPressed public property

public ButtonPressed OnShieldKeyPressed
return ButtonPressed

OnShieldKeyUp public property

public ButtonUp OnShieldKeyUp
return ButtonUp

OnShieldkeyDown public property

public ButtonDown OnShieldkeyDown
return ButtonDown

OnStartPress public property

public ButtonPressed OnStartPress
return ButtonPressed

OnSuperKeyPressed public property

public ButtonPressed OnSuperKeyPressed
return ButtonPressed

OnSuperKeyUp public property

public ButtonUp OnSuperKeyUp
return ButtonUp

OnSuperkeyDown public property

public ButtonDown OnSuperkeyDown
return ButtonDown