Documentation
¶
Index ¶
- Constants
- type StateFunction
- type StateMachine
- func (sm *StateMachine) AddState(id int, fn StateFunction)
- func (sm *StateMachine) Peek() bool
- func (sm *StateMachine) PopInt() int
- func (sm *StateMachine) PopString() string
- func (sm *StateMachine) PushInt(value int)
- func (sm *StateMachine) PushString(value string)
- func (sm *StateMachine) SetState(state int)
- func (sm *StateMachine) Step() error
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
Click to show internal directories.
Click to hide internal directories.