Hello everyone!
Im using mvc framework for wrapper. So i have UIController, UIView for this problem.
The object of type UIView is display object and works as container(like in ActionScript). So it holds some static buttons wich control sound,fullscreen and etc. and another dynamic controls wich control the state and current rules of the game.
When the game is in different states the buttons can be active or inactive for pressing, can be with different texts over them, wich can cause different functionallity to be performed in the controller.
So i have around 10-13 states of the game in wich the ui buttons are in different state so:
Control state of the buttons in the controller. It is not ok cuz the controller is more than 300 rows and its ugly for reading and understanding. It shouldnt be.
To create custom object in the controller and to pass to it the ui buttons and with some function called changeState to set the appropriate appearance to the buttons.
How to structure and name that custom object to be enough descriptive. Or is there some well known pattern ? Or do u have better idea ?
↧