IStateMachine.cs 1019 B

12345678910111213141516171819202122232425262728293031323334353637
  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. int LastMsg { get; }
  15. int PrevState { get; }
  16. void Start();
  17. void Loop();
  18. void Stop();
  19. void Transition(int state, int msg, FsmFunc func, int next);
  20. void AnyStateTransition(int msg, FsmFunc func, int next);
  21. void EnterExitTransition(int state, FsmFunc enter, int msg, FsmFunc exit);
  22. void PostMsg(int msg, object[] args);
  23. void MapState(int state, string stringState);
  24. void MapMessage(int message, string stringMessage);
  25. bool FindTransition(int state, int msg);
  26. bool CheckExecuted(int msg);
  27. bool CheckExecuted(int msg, out int currentMsg, out List<int> msgQueue);
  28. }
  29. }