terrybuck / Evilution

2D Game where one attempts to thwart an ever evolving evil
0 stars 0 forks source link

GameTimer fails to encapsulate its private state variables #34

Closed andrewanderson closed 6 years ago

andrewanderson commented 6 years ago

https://github.com/terrybuck/Evilution/blob/d9c256c202a1a5f60a6fa1b8afed8de6246d8493/EvilEvolved/EvilEvolved/GameTimer.cs#L100-L113

I don't think the GameTimer wants to allow its consumers public access to all of these internal state variables, does it? Certainly allowing "set" access seems risky - and I'm not sure the utility of "get" access (although perhaps that's in the future plan?)

terrybuck commented 6 years ago

That is a good point, I admit I wrote the game timer while following a tutorial after just starting the project and I haven't revisited it since. I do not require direct access to any of those variables outside of game timer, in particular it would be a problem if I were to accidentally set IsUpdating to true in a different location.

I will change these.

terrybuck commented 6 years ago

Closed with commit debfc9dcbcbc2d0058a90850b9dbc03d68fff061