Why we need new design?
- Player has no ability to play white.
- You can't play with friend (I mean hotseat mode).
Why we can't do changes at existing code?Because current design has very bad level of abstraction: KReversiView controls part of game-flow, all code based on Computer-Player system with special code for computer and player moves, so to simply implement player-player mode we need to add many IF-statements to KReversiView, KReversiGame and mainwindow code.
What is new design?I am going to bring especially new level of abstraction to KReversi:
- KReversiGame will control all of game-flow and game rules checking
- There will be KReversiPlayer interface. KReversiGame will have two such objects, that represent players
- There will be two implementations of KReversiPlayer class: KReversiHumanPlayer (for actual player sitting in front of computer), KReversiComputerPlayer (for AI player)
- KReversiView will not control any game rules, only UI and simple signal to indicate that somebody had pressed some cell on field