Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Int property within range #330

Open
ljacqu opened this issue Jul 3, 2023 · 1 comment
Open

Int property within range #330

ljacqu opened this issue Jul 3, 2023 · 1 comment

Comments

@ljacqu
Copy link
Member

ljacqu commented Jul 3, 2023

I might want to have an int property that can only be, for example, between 0 and 10. It would be nice to just let ConfigMe handle it and to be sure that the value is within the range.

@ljacqu ljacqu added good-first-issue Want to contribute? This label marks well-defined, [relatively] straightforward issues and removed good-first-issue Want to contribute? This label marks well-defined, [relatively] straightforward issues labels Aug 29, 2023
@gamerover98
Copy link
Contributor

gamerover98 commented Oct 27, 2023

Yeah, it can be done for all other numeric types!
For example, FloatProperty with a range like:

public class FrequencyProperty extends/implements FloatProperty {
    @Override
    public float maxValue() {
        return 1.0F;
    }
   
    @Override
    public float minValue() {
        return -1.0F;
    }
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants