Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add API for providing default values if property is not present #1249

Open
AlmasB opened this issue Mar 23, 2023 · 1 comment
Open

Add API for providing default values if property is not present #1249

AlmasB opened this issue Mar 23, 2023 · 1 comment
Labels
type:new feature Adding a feature that isn't currently present

Comments

@AlmasB
Copy link
Owner

AlmasB commented Mar 23, 2023

Example:

String s = gets("playerName", "defaultValue");

@AlmasB AlmasB added the type:new feature Adding a feature that isn't currently present label Mar 23, 2023
@chengenzhao
Copy link
Contributor

chengenzhao commented Mar 29, 2023

Would it be better if also provie an api like

states.<T>getValue(String key, T t);
//e.g.
var cash = states.<Number>getValue("cash", 0.0);

@AlmasB AlmasB added this to the 21 milestone Mar 30, 2023
@AlmasB AlmasB removed this from the 21 milestone Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:new feature Adding a feature that isn't currently present
Projects
None yet
Development

No branches or pull requests

2 participants