jkomoros / boardgame

An in-progress framework in golang to easily build boardgame Progressive Web Apps
Apache License 2.0
31 stars 4 forks source link

Have a way to decide which animations to skip clientside #717

Open jkomoros opened 6 years ago

jkomoros commented 6 years ago

By default we render every state, and wait for any animations to finish. And every state is sent down.

But sometimes there are states we want to skip animating. For example if the user has picked "no animations" or there are just some moves that would animate but we want to skip animating on.

The game renderer will have its SkipAnimation(beforeMove, afterMove) consulted (BaseGameRenderer has a stub that just returns false). If it's true, won't even databind the state, will just skip to the last one where SkipAnimation between it and its next state returns false.

Originally captured in #396.

jkomoros commented 6 years ago