Coder Social home page Coder Social logo

fsm's People

Contributors

armandoalonso avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

 avatar

fsm's Issues

debugger issue toString

FSMdebug.zip
steps to reproduce:

  1. drag zip into c3
  2. preview
  3. open the debugger and select the instance in it

observed:
keeps logging this error and creates infinite behavior instances
image

[Enhancement] compare current state to list of states

When I am using a FSM I often have the same logic that should run when the FSM is one of many states.
This can currently be solve like this:
image
with an or block, the downside of this is that the conditions can get very long and more importantly it's fairly heavy as the event system loops over the picked instances once per condition.
To fix that I sometimes use a conditional operator like this:
image
this solves the performance overhead, but becomes hard to read because of the repeated "player.FSM.CurrentState ="

So my suggested solution would be an alternative condition where we can put in a list of states, it could look something like this:
image
so it allows for a variable number of arguments separated by commas, if possible.

I guess one might argue you are not supposed to use a state machine like this, maybe? But to me this seems like a sensible thing to do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.