lmas / opensimplex

This repo has been migrated to https://code.larus.se/lmas/opensimplex
MIT License
241 stars 29 forks source link

Add ability to get the currently set seed value #39

Closed bigwhoopgames closed 1 year ago

bigwhoopgames commented 1 year ago

Please add a function or attribute that allows for the retrieval of the currently set seed value.

lmas commented 1 year ago

Hi, this is easily done. But any particular motivation for having it done in the library and not in your own code? Just curious.

bigwhoopgames commented 1 year ago

In general it is better to have a single source of truth about a particular setting or variable. Relying on each project to save and track seed values in their own unique way leads to the possibility of error or bugs, whereas if it is just a simple and reliable call to the module itself there is no possibility of error.

lmas commented 1 year ago

If you're able to set up any kind of state in a project, it shouldn't be difficult to track a single integer that was used once. I agree with using a single source of truth though.

Is #40 good enough?

lmas commented 1 year ago

Merged and closed due to inactivity.