Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type StateMachine interface {
- void Enter();
- void Update();
- void Exit();
- }
- type DefaultStateMachine struct {}
- void (dsm *DefaultStateMachine) Enter() {}
- void (dsm *DefaultStateMachine) Update() {}
- void (dsm *DefaultStateMachine) Exit() {}
- ... (meanwhile in another package) ...
- type UserStateMachine struct {
- gofsm.DefaultStateMachine
- }
- void (usm *UserStateMachine) Update() {
- // User code here, adheres to the interface without forcing methods, etc.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement