C# Class Sharplike.Core.ControlFlow.StateMachine

Afficher le fichier Open project: eropple/sharplike Class Usage Examples

Méthodes publiques

Méthode Description
CreateStack ( String stackName, AbstractState rootState ) : void

Creates a new stack within the StateMachine.

DestroyStack ( String stackName ) : void

Destroys any non-main, currently inactive stack.

GameLoopTick ( Sharplike loop ) : System.Boolean
PopState ( ) : AbstractState

Pops a state off of the currently active stack. Control flow will return to the next most recent state in the stack, or will terminate execution of the game the last state in the main stack is popped.

PopState ( String stackName ) : AbstractState

Pops a state off of any specified stack. Execution of the game will terminate if the last state is popped from the main stack, and an exception will be thrown if the last state in any other stack is popped.

PushState ( AbstractState newState ) : void

Pushes a state onto the currently active stack (making it the new running state).

PushState ( String stackName, AbstractState newState ) : void

Pushes a state onto the specified stack.

StateMachine ( AbstractState rootState ) : System

Constructor.

SwitchStack ( String stackName ) : void

Switches execution of the state machine to the specified stack.

Private Methods

Méthode Description
GameProcessing ( object sender, EventArgs e ) : void
InputSystem_CommandEnded ( object sender, Input e ) : void
InputSystem_CommandStarted ( object sender, Input e ) : void
InputSystem_CommandTriggered ( object sender, Input e ) : void

Method Details

CreateStack() public méthode

Creates a new stack within the StateMachine.
public CreateStack ( String stackName, AbstractState rootState ) : void
stackName String The string key for the new stack.
rootState AbstractState The start state for the new stack.
Résultat void

DestroyStack() public méthode

Destroys any non-main, currently inactive stack.
public DestroyStack ( String stackName ) : void
stackName String The string key of the stack to destroy.
Résultat void

GameLoopTick() public méthode

public GameLoopTick ( Sharplike loop ) : System.Boolean
loop Sharplike
Résultat System.Boolean

PopState() public méthode

Pops a state off of the currently active stack. Control flow will return to the next most recent state in the stack, or will terminate execution of the game the last state in the main stack is popped.
public PopState ( ) : AbstractState
Résultat AbstractState

PopState() public méthode

Pops a state off of any specified stack. Execution of the game will terminate if the last state is popped from the main stack, and an exception will be thrown if the last state in any other stack is popped.
public PopState ( String stackName ) : AbstractState
stackName String The stack from which to pop a state.
Résultat AbstractState

PushState() public méthode

Pushes a state onto the currently active stack (making it the new running state).
public PushState ( AbstractState newState ) : void
newState AbstractState The state to add to the currently active stack.
Résultat void

PushState() public méthode

Pushes a state onto the specified stack.
public PushState ( String stackName, AbstractState newState ) : void
stackName String The stack on which to place the state.
newState AbstractState The state to add to the specified stack.
Résultat void

StateMachine() public méthode

Constructor.
public StateMachine ( AbstractState rootState ) : System
rootState AbstractState The root state to start the StateMachine on.
Résultat System

SwitchStack() public méthode

Switches execution of the state machine to the specified stack.
public SwitchStack ( String stackName ) : void
stackName String The string key of the stack to which the state machine shall switch execution.
Résultat void