BorisTheBrave / DeBroglie

DeBroglie is a C# library implementing the Wave Function Collapse algorithm with support for additional non-local constraints, and other useful features.
https://boristhebrave.github.io/DeBroglie/
MIT License
456 stars 37 forks source link

Specify invariant culture when parsing doubles #15

Closed grapefrukt closed 3 years ago

grapefrukt commented 3 years ago

I wanted to play around with WFC for a bit and the console version of this library seemed like a perfect match, I could however not get it to parse any of the config files without throwing an error.

After some investigation it turns out it's due to me having my computer set to a Swedish locale, which means it uses comma as a decimal separator. The double.Parse() call heeds this and will promptly refuse to parse the config files. A small change to specify the Invariant culture fixes this issue.