IStateMachine.cs 888 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Aitex.Core.RT.Fsm
  6. {
  7. public delegate bool FsmFunc(object[] param);
  8. public interface IStateMachine
  9. {
  10. string Name { get; set; }
  11. int ElapsedTime { get; }
  12. int EnterTime { set; }
  13. int State { get; }
  14. void Start();
  15. void Loop();
  16. void Stop();
  17. void Transition(int state, int msg, FsmFunc func, int next);
  18. void AnyStateTransition(int msg, FsmFunc func, int next);
  19. void EnterExitTransition(int state, FsmFunc enter, int msg, FsmFunc exit);
  20. void PostMsg(int msg, object[] args);
  21. void MapState(int state, string stringState);
  22. void MapMessage(int message, string stringMessage);
  23. bool FindTransition(int state, int msg);
  24. void EnableRepeatedMsg(bool enable);
  25. }
  26. }