This is a naïve implementation of #371. An additional, mandatory argument is included for all sampler functions which is cast to long. It seems to work and comply with the issue, but is inelegant and suspiciously simple.
In theory, this could be a non-breaking change if it used function overloading or optional arguments, but to my limited knowledge, this isn't currently possible. Every function is required to provide a static number of arguments through com.dfsek.paralithic.functions.Function#getArgNumber(int) and no two functions can share the same name as they're stored in a Map<String, Function>.
I request any feedback on if this actually solves the issue or if it could be improved in any way so that I may learn and be better able to contribute.
Closes #371
Changelog
[x] Additional argument for sampler functions in EXPRESSIONs.
Checklist
Mandatory checks
[x] The base branch of this PR is an unreleased version branch (that has a ver/ prefix)
or is a branch that is intended to be merged into a version branch.
[x] There are no already existing PRs that provide the same changes.
[x] The PR is within the scope of Terra (i.e. is something a configurable terrain generator should be doing).
[x] Changes follow the code style for this project.
[x] I have read the CONTRIBUTING.md
document in the root of the git repository.
Types of changes
[ ] Bug Fix
[ ] Build system
[ ] Documentation
[x] New Feature
[ ] Performance
[ ] Refactoring
[ ] Repository
[ ] Revert
[ ] Style
[ ] Tests
[ ] Translation
Compatibility
[x] Introduces a breaking change
[ ] Introduces new functionality in a backwards compatible way.
[ ] Introduces bug fixes
Documentation
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
Testing
[ ] I have added tests to cover my changes.
[x] All new and existing tests passed.
Licensing
[x] I am the original author of this code, and I am willing to
release it under GPLv3.
[ ] I am not the original author of this code, but it is in public domain or
released under GPLv3 or a compatible license.
Pull Request
Description
This is a naïve implementation of #371. An additional, mandatory argument is included for all sampler functions which is cast to
long
. It seems to work and comply with the issue, but is inelegant and suspiciously simple.In theory, this could be a non-breaking change if it used function overloading or optional arguments, but to my limited knowledge, this isn't currently possible. Every function is required to provide a static number of arguments through
com.dfsek.paralithic.functions.Function#getArgNumber(int)
and no two functions can share the same name as they're stored in aMap<String, Function>
.I request any feedback on if this actually solves the issue or if it could be improved in any way so that I may learn and be better able to contribute.
Closes #371
Changelog
EXPRESSION
s.Checklist
Mandatory checks
ver/
prefix) or is a branch that is intended to be merged into a version branch.CONTRIBUTING.md
document in the root of the git repository.Types of changes
Compatibility
Documentation
Testing
Licensing