18 lines
440 B
Go
18 lines
440 B
Go
package fsmcore
|
|
|
|
import "gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/handler/fsm/fsmcontract"
|
|
|
|
type HandleFunc func(ctx fsmcontract.Context) (fsmcontract.State, fsmcontract.Context, error)
|
|
|
|
type State struct {
|
|
next HandleFunc
|
|
}
|
|
|
|
func (s *State) Handle(ctx fsmcontract.Context) (fsmcontract.State, fsmcontract.Context, error) {
|
|
return s.next(ctx)
|
|
}
|
|
|
|
func NewState(next HandleFunc) fsmcontract.State {
|
|
return &State{next: next}
|
|
}
|