OOSD Board Game, for Object Oriented Software Design (ISYS1083), Group G3.
-
Please refer to PDF version of this document if you can't render markdown in your environment.
-
Please be aware that our group contribution are not equal, i.e. not everyone has 25%. The rate is listed below:
Member name & student ID Contribution Rate Works done Ming Hu (s3554025) 45% All coding works, including this README file; Diagram corrections; Presentation slide corrections Yixiong Shen (s3700889) 18.3% Presentation slides Xuan Gia Khanh Nguyen (s3636905) 18.3% Class diagrams Tuan Manh Nguyen (s3574923) 18.3% Final report Please refer to the contribution confirmation sheet for more details.
-
This README file is a reference for team member to understand the code and help them for designing diagram, presentation slide and reports. If there is any conflicting content with the final report, please refer to that document first.
Code written, tested and debugged by Ming Hu (s3554025).
Icons are from Alibaba's IconFont, free for non-commercial use.
This program is written and tested in JDK 8 environments. Since lambda and some other newer JavaFX features have been used, JDK 7 will not work.
If you are using OpenJDK in some Linux distro, please remember to configure JavaFX separately.
You may also need to set Cofoja separately before compile. Please refer to this tutorial for more information.
- Basics
- JavaFX GUI
- Menu bar
- MVC design structure
- Gameplay
- Round based game demo
- Countdown timeout for each turn
- Capture phrases (Assignment 2)
- Defensive mode (Assignment 2)
- Grade/win state (Assignment 2)
- Board
- 8x8 board, 64 cells
- Un-do/Re-do support (Assignment 2)
- Status save/reload (Assignment 2)
- Board resizing (Assignment 2)
- Piece
- CSS styled
- Movable
- Settings (Assignment 2)
- Variable board size
- Variable piece count
- Custom player name
- Player
- Initial mark deduction info
- Turn based
- "About" window
- Hotkey bindings on menu bar
Assignment 2 has implemented/refactored with 5 design patterns, which are:
- Prototype
- located in
models.piece.PieceGenerator
class- It is used for creating pieces correctly
- prevents using unnecessary initialization code.
- located in
- Command
- located in
PieceFactory
,PieceCreator
class- It shortens the code with lambda (no more if-else or switch-case needed)
- simplify the process for adding new pieces/characters
- located in
- Decorator
- located in package
models.pieces
- It simplifies the process for adding new pieces/characters
- It allows flexible extension to a existing piece
- located in package
- Chain of Responsibility
- located in
helpers.reactions
package- It simplifies & decouples the request when the app creates notification/logging
- located in
- Abstract Factory
- located in
models.factory
package (together with command pattern)- It limits direct access for concrete classes.
- located in
NOTICE: Since Cofoja may not work correctly on Intellij IDEA and the program may be failed to compile. The development environment follows the configurations in this tutorial and the project can pass compiling and testing with no issue.
These code mentioned below are using Cofoja:
- controllers
- logic
CompeteManager
GameLogic
StatusManager
HomeController
SettingController
- logic
- helpers
- reactions
CrashReactions
DebugReactions
WarningReactions
BoardButtonHelper
- reactions
- models
- board
Board
- coordinate
Coordinate
- factory
PieceFactory
PlayerFactory
CoordinateFactory
- piece
- some decorator classes
PieceGenerator
SimplePiece
- player
CommunismPlayer
CapitalismPlayer
- board
- Piece model classes are using Decorator design pattern. The properties in a certain piece are decorated by decorator classes.
- Buttons in the board are automatically generated, not directly written into FXML. It also allows users to change the size of board between 6x6 to 18x18 dynamically.
-
GameLogic
class andHomeController
class- No method with long section of code
- Well categorised,
GameLogic
in charge of game logic only, whileHomeController
handles UI stuff.
-
Board
class,Piece
class andCoordinate
class- Model classes to store game status, with levels
- Different level has its own responsibility, but they need to work together.
Board
contains a list ofPiece
, eachPiece
has its ownCoordinate
- Abstract factory pattern is used in this project for creating contents in the board.
- This app is based on MVC design structures, so it has controllers
- Controllers are
GameLogic
which controls gameplay logic andHomeController
which controls GUI. (it also sounds like Pure Fabrication to some extent???)
Piece
interface for piece modelsPlayer
interface for player modelsPieceGenerator
interface for generating
GameLogic
controls gameplay logic andHomeController
controls GUI.- If models need to control UI, they need to talk to
HomeController
first to ensure no invalid data is updated to UI.
- If models need to control UI, they need to talk to
- Also for
CompeteManager
andStatusManager
. If the data is invalid, then it won't be updated to UI. Instead, there will be a proper warning message/debug log will be shown.
- Game logic code are separated to three classes, which are
GameLogic
,CompeteManager
andStatusManager
.GameLogic
only responsible the low-level logicsCompeteManager
handles the move range and attack range evaluationStatusManager
saves or restores the status or the board
GameLogic::selectPiece
andGameLogic::placePiece
are in private level- These two methods should not be changed and misused by others
- Piece models are in proper
SimplePiece
has the correct implementation underPiece
- All piece methods in
Piece
interface are in use
Piece
interface for piece modelsPlayer
interface for player modelsPieceGenerator
interface for generating- The way of
GameLogic
class and piece list inBoard
class dealing with different pieces.
- Piece models are using decorator pattern and command pattern with lambda. It significantly reduces extra code in the initialization.