Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a version of ShadowTheAge#181, allowing XXb to specify XX b…
…elts of production. (#128) Also look for /s, /m, or /h suffixes. If present, use that suffix regardless of the current display settings. The objectives of this change are: * Allow specifying a certain number of belts of production or consumption, by typing "XXb" * Correctly parse /s, /m, and /h suffixes, regardless of the current display preferences. * Preserve existing behavior with regards to case sensitivity and bare-number input: * Preserve mW == MW for now * "100" still means 100 of whatever unit is normally displayed in that box. * Be as permissive as reasonable about whitespace. (More permissive than I intended, to allow parsing the "10 000" output from calling `FormatValue(..., precise: true)`) * Correctly parse any string YAFC can display: * Allow p and /t suffixes when they have meanings in the preferences. (That said, /t always has a meaning.) * Fix the bug that "10W" is parsed as ten megawatts instead of ten watts. * Prevent use of non-applicable units or garbage input: * No reporting you built "5/m" buildings or "30%" beacons, and no sticking a "?" anywhere in your input. * On the other hand, do allow "+15e+4", which is valid formatting for a float.
- Loading branch information