C# Класс Sharplike.Core.ControlFlow.StateMachine

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CreateStack() публичный Метод

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.
Результат void

DestroyStack() публичный Метод

Destroys any non-main, currently inactive stack.
public DestroyStack ( String stackName ) : void
stackName String The string key of the stack to destroy.
Результат void

GameLoopTick() публичный Метод

public GameLoopTick ( Sharplike loop ) : System.Boolean
loop Sharplike
Результат System.Boolean

PopState() публичный Метод

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
Результат AbstractState

PopState() публичный Метод

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.
Результат AbstractState

PushState() публичный Метод

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.
Результат void

PushState() публичный Метод

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.
Результат void

StateMachine() публичный Метод

Constructor.
public StateMachine ( AbstractState rootState ) : System
rootState AbstractState The root state to start the StateMachine on.
Результат System

SwitchStack() публичный Метод

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.
Результат void