You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of the upload restriction, I have uploaded the assets and the javafx library on github instead.
Explanation
The Server and Client class handler communications between the network members.
The class GameData contains the static data, such as all cards and all heros in the game.'
The class ServerController contains data about the whole server, such as player count and game count.
The classes ClientController (on the client side) & ClientHandler (on the server side) extend the class Controller and each instance of these classes, contains the data for one client, such as current player, etc.
The Server and Client pass the messages as Strings, which is then turned into a Command object by the recipient (using the CommandParser class).
Each controller instance has a CommandRunner instance (ServerCommandRunner or ClientCommandRunner which extend CommandRunner) which runs the commands.
GameTypes represent the different types of games: single player (with NPC), offline multiplayer (practice mode), online multiplayer, deck reader.
If a client wants to join a multiplayer game, they are put in a queue in the Server. After 2 clients are matched, a GameHandler instance is created for the game.
The classes in the packages: elements, commands, shared & system are used by both the Server & Client, but they are only information holding classes and the server and client can only modify each other through commands.
The Updater class writes json (which can be read by the configor class added in phase 3). The class being updated needs only to extend Updatable and have a config file specifying which fields should be written in the json.
External Libraries
Javafx v11.0.2: I used this library because of the variation of its tools and because it can be used together with fxml and css, resulting in more concise code.
Gson v2.8.6: The classes JsonReader and JsonWriter in this library are easy yet flexible tools for working with Json files.
Positive Points
The Command system is very clean and concise and has a high level of abstraction.
Different Game Types are implemented without repetitive code.
The whole code has a good level of abstraction.
The Configor and Updater class allow a lot of flexibility and require little change to be used for new classes.
Negative Points
The target selection system from last phase has lost some functionality.
A lot of details are omitted. (Disconnection error, etc.)
The Configor and Updater class make the debugging process a lot harder.