ariejan / space_engineer

Conquer the galaxy, one click at a time!
Mozilla Public License 2.0
0 stars 1 forks source link

Create a Cooldown class #11

Closed ariejan closed 4 years ago

ariejan commented 4 years ago

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.