daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Sep 26th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top