Skip to main content
edited tags
Link
user1430
user1430
edited tags; edited title
Link
user1430
user1430

Avoid How can I avoid tons of if else pattern everywhere depending on game/else statements dealing with settings?

Source Link

Avoid if else pattern everywhere depending on game settings

I am creating a sudoku game using the android sdk. I have a PreferenceActivity filled with different settings, such as "Highlight all digits" or "activate the visual helper". The problem is that I am trying to avoid using the if else pattern everywhere in my code in order to check if each settings is activated to execute a specific code. I am looking for the best pattern that could help me to handle my different settings. My code is pretty clear(I think), I have a Grid class containing all the grid information and a Game view, that handles inputs and interacts with the Grid class.