C# Class SmashBros.Controllers.GamepadController

The gamepad controller uses the gamestate to determine which controllers to use
Inheritance: Controller
显示文件 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_oe property

public ButtonPressed OnBackPress
return ButtonPressed

OnHitKeyPressed public_oe property

public ButtonPressed OnHitKeyPressed
return ButtonPressed

OnHitKeyUp public_oe property

public ButtonUp OnHitKeyUp
return ButtonUp

OnHitkeyDown public_oe property

public ButtonDown OnHitkeyDown
return ButtonDown

OnNavigation public_oe property

public NavigationKey OnNavigation
return NavigationKey

OnShieldKeyPressed public_oe property

public ButtonPressed OnShieldKeyPressed
return ButtonPressed

OnShieldKeyUp public_oe property

public ButtonUp OnShieldKeyUp
return ButtonUp

OnShieldkeyDown public_oe property

public ButtonDown OnShieldkeyDown
return ButtonDown

OnStartPress public_oe property

public ButtonPressed OnStartPress
return ButtonPressed

OnSuperKeyPressed public_oe property

public ButtonPressed OnSuperKeyPressed
return ButtonPressed

OnSuperKeyUp public_oe property

public ButtonUp OnSuperKeyUp
return ButtonUp

OnSuperkeyDown public_oe property

public ButtonDown OnSuperkeyDown
return ButtonDown