PatamProject / Patam-BookScrabble

1 stars 0 forks source link

changes made to the code #77

Open mayageva11 opened 1 year ago

mayageva11 commented 1 year ago

changes made to the code after the meeting and changes of the UML, By implementing these changes, the project aimed to consolidate the work, address duplicate code, improve communication protocols, introduce game logic, and establish necessary components for error handling, logging, and user interaction. all worked together.

mayageva11 commented 1 year ago

the changes made: 1.It was decided that the shared class between the host and the client would be called "MyPlayer." This class would handle the communication and functionality common to both. 2.A communication interface was introduced, which included methods for initiating and closing the communication. These methods were implemented in the "ClientCommunication" and "MyHostServer" classes. They were responsible for establishing a proper communication connection with the server and closing it appropriately. 3.The "ClientCommunication" and "MyHostServer" classes were modified to align with the updated communication protocol, which made them more accessible and efficient. 4.The "RequestHandler" interface was introduced, which sent requests from the "HostSideHandler" and "ClientSideHandler" classes according to the communication protocol. These classes performed the required actions based on the requests received.

  1. The "HostSideHandler" and "ClientSideHandler" classes were responsible for transferring communication between the host and the server, as well as between the client and the host, respectively.
  2. The "GameModel" class was created to handle the game logic. It included methods for adding or removing players, determining the current turn, and other game-related functionality.
  3. The introduction of the VIEWMODEL included the following components: a.The "Error_Codes" class handled predefined error conditions, such as having too many players or an invalid name. b.The "MyLogger" class facilitated logging game-related information to the console, allowing us to run the game in the terminal temporarily until we could connect it to another location. c.The "RunClient" class served as the entry point for the user. When a player wanted to connect, the game would run the "RunClient" class in the background, which would initiate the necessary processes.