FLAMEGPU2 icon indicating copy to clipboard operation
FLAMEGPU2 copied to clipboard

Improve Default state arguments

Open ptheywood opened this issue 2 years ago • 1 comments

If users provide custom state names, methods which optionally take a state name as an argument will fail at run time if one is not provide with an exception stating that the state (default) does not exist.

We must be able to improve this exception, or ideally prevent it from occuring in some cases?

E.g. we could mark a state as the default for a given agent type, which if one is not provided by the user it is used instead? By default, this could still be the implicitly created default state, otherwise it could just be the first state specified for a given agent type?

Alternatively we could just improve the exception message in host code, given that the list of potential states must be known for a given agent type to discover that it does not exist?. Maybe with a special case for when default does not exist with a more user-freindly error.

https://github.com/FLAMEGPU/FLAMEGPU2/discussions/906

ptheywood avatar Aug 19 '22 10:08 ptheywood

User with a related issue.

https://github.com/FLAMEGPU/FLAMEGPU2/discussions/1091#discussioncomment-6480180

Robadob avatar Jul 19 '23 07:07 Robadob