The Architecture Notice

There are few major note to take when it comes to architecture of this package.

  1. For every GUI classes must have one chess game logic dictating the underlying computation for "backend job", the GUI classes are mainly responsible for Unity stuff such as manipulating UI and Game Object while chess game logic is responsible for CPU computational work and chess related stuff. This design is made to decouple from various aspect while maximize code reusability.

  2. Every new extension to any inheritence of GUI classes, if is calling any functions to the game logic(ChessGameBase class and all of its inheritence), has to use Game instead of game variable as Game variable has auto boxing conversion to its intended inheritence level for every function calls.

  3. For all GUI classes, InitializeChessGameInstance(ChessGameInitializeInfo) function has been prepared for initializing chess game logic, for gameInitInfo variable to have their instance remain as state for when restarting a game etc. Just for a more organized and cleaner code. It is recomended to use or override the function for every game logic initialization.

  4. Every new extension to any inheritence of GUI classes is forbidden to instantiate game logic that is not the exact class of the Game variable has to offer as it will easily cause bug. However, override Game variable to a higher inheritence than of it's parent GUI class is possible, but never for a lower inheritence level. For example, see image below.

Last updated