playMaker

Author Topic: Code generation with a list of variables, events, states from FSM  (Read 1546 times)

strannik

  • Playmaker Newbie
  • *
  • Posts: 2
Hi,
Is exists a solution for code generation with a list of variables, events, states from FSM?
For example, instead of a string into a parameters - behavior.Fsm.Event("MyEventName")
to use generated constants - behavior.Fsm.Event(MyFsm.Events.MyEventName).

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Code generation with a list of variables, events, states from FSM
« Reply #1 on: February 18, 2014, 10:47:09 AM »
We don't currently generate any code.
Instead of using strings for events, you can get a reference to an FsmEvent object that you can re-use:
Code: [Select]
FsmEvent myEvent = FsmEvent.FindEvent("MyEventName");

strannik

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Code generation with a list of variables, events, states from FSM
« Reply #2 on: February 18, 2014, 12:04:57 PM »
References course is better than strings. But code generation would be even better. Probably i will try to write this utility itself.