-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
Jakub Pelc edited this page Jun 16, 2023
·
1 revision
The project is split into 4 separate packages:
-
Controller
- Contains classes that act as a middleman in communication in between the classes contained in the remaining three packages.
- lobbyController, chatController, and Gamecontroller send and receive messages to and from the server that contain the information of actions of a single player (in a way a two-way channel for communication for the current player).
- listener classes act as a receiver for messages broadcasted from the server (update command), so that all players receive information about the changes resulting from a different player's action (move, connecting, picking teams,..).
-
GUI
- Contains classes that serve as a visualization of the current game/lobby data and progress. They contain an update function that is invoked by the corresponding controller when receiving new data from the server.
- They also serve as the main input medium for the program (choices made by pressing buttons or entering text into a field).
-
Model
- The core of the game.
- Contains classes that hold data corresponding to every piece of information that is in some way used in the logic of the code or are sent to or from the server.
-
Server
- the Server class holds information about all the sessions that are currently running on it.
- AnswerParser and CommandParser are helper classes that convert received messages (from client or from server) into objects depending on the sent keyword.
- ServerThread acts as the main interpreter of commands sent to the server. Depending on the command and arguments received executes corresponding actions or sends exception messages back. After a successful execution broadcasts an update command to the rest of the clients.
- All classes in GUI implement some function of JavaFX.
- Server and Controller classes communicate on threads on TCP ports.