statemachine

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const STACK_SIZE = 64

Variables

This section is empty.

Functions

This section is empty.

Types

type StateFunction

type StateFunction func(sm *StateMachine) error

type StateMachine

type StateMachine struct {
	// contains filtered or unexported fields
}

func NewStateMachine

func NewStateMachine(stateCount int) *StateMachine

func (*StateMachine) AddState

func (sm *StateMachine) AddState(id int, fn StateFunction)

func (*StateMachine) Peek

func (sm *StateMachine) Peek() bool

func (*StateMachine) PopInt

func (sm *StateMachine) PopInt() int

func (*StateMachine) PopString

func (sm *StateMachine) PopString() string

func (*StateMachine) PushInt

func (sm *StateMachine) PushInt(value int)

func (*StateMachine) PushString

func (sm *StateMachine) PushString(value string)

func (*StateMachine) SetState

func (sm *StateMachine) SetState(state int)

func (*StateMachine) Step

func (sm *StateMachine) Step() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL