Advertisement
Guest User

Untitled

a guest
Sep 26th, 2018
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. type StateMachine interface {
  2. void Enter();
  3. void Update();
  4. void Exit();
  5. }
  6.  
  7. type DefaultStateMachine struct {}
  8.  
  9. void (dsm *DefaultStateMachine) Enter() {}
  10. void (dsm *DefaultStateMachine) Update() {}
  11. void (dsm *DefaultStateMachine) Exit() {}
  12.  
  13. ... (meanwhile in another package) ...
  14.  
  15. type UserStateMachine struct {
  16. gofsm.DefaultStateMachine
  17. }
  18.  
  19. void (usm *UserStateMachine) Update() {
  20. // User code here, adheres to the interface without forcing methods, etc.
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement