GameState currently has a mining cooldown as global state:
int miningCooldown;
double miningCooldownFraction;
In HomeViewModel we even create a miningOnCooldown boolean.
It'd be much nicer to have a Cooldown class that contains the actual cooldown time; current time left and can return a 0..1 fraction and report if we're still on cooldown or not. This would make keeping track off and updating cooldowns much easier in the reducers.
GameState
currently has a mining cooldown as global state:In
HomeViewModel
we even create aminingOnCooldown
boolean.It'd be much nicer to have a
Cooldown
class that contains the actual cooldown time; current time left and can return a 0..1 fraction and report if we're still on cooldown or not. This would make keeping track off and updating cooldowns much easier in the reducers.