I've got a small project where I would like to avoid creating a setter for each integer. So I'm thinking if it's even possible.
So I would like to set an amount of
player.setResource(player.money, 100);
,
player.setResource(player.coal, 20);
,
etc.
I'm not sure first of all if it's possible, and second of all how to write a function itself.
public void setResource(int resource, int amount)
{
???
}