Refactor of network stack

This commit is contained in:
2026-06-09 19:23:58 +02:00
parent 73f3d152af
commit 2fb43c385b
18 changed files with 94 additions and 92 deletions
@@ -83,7 +83,7 @@ public class Game implements Serializable {
* @param totem the selected totem.
* @return {@code true} if the choice is applied successfully, {@code false} otherwise.
*/
public synchronized boolean TotemChoice(Player player,Totems totem) {
public synchronized boolean totemChoice(Player player,Totems totem) {
if(!currentState.getGameStage().equals(GameStages.TOTEM_CHOICE))
return false;
if(!getCurrentState().getCurrentPlayer().equals(player))
@@ -135,7 +135,7 @@ public class Game implements Serializable {
* @return {@code true} if the disconnection is handled successfully,
* {@code false} if the player was already marked as disconnected.
*/
public synchronized boolean DisconnectedPlayer(Player player)
public synchronized boolean disconnectedPlayer(Player player)
{
if(disconnetedPlayers.containsKey(player) && disconnetedPlayers.get(player))
{
@@ -177,7 +177,7 @@ public class Game implements Serializable {
* @return {@code true} if the reconnection is handled successfully,
* {@code false} if the player was not previously marked as disconnected.
*/
public synchronized boolean ReconnectPlayer(Player player)
public synchronized boolean reconnectPlayer(Player player)
{
if(!disconnetedPlayers.containsKey(player))
{
@@ -516,7 +516,7 @@ public class Game implements Serializable {
* @param player the player skipping the turn .
* @return {@code true} if the skip succeeds, {@code false} otherwise.
*/
public boolean SkipTurn(Player player) {
public boolean skipTurn(Player player) {
if(currentState.getGameStage()!= GameStages.RES_ACTIONS && !currentState.getGameStage().equals(GameStages.OPT_CARD_E))
{
return false;
@@ -992,7 +992,7 @@ public class Game implements Serializable {
* in the first position of the final ranking. The remaining players are
* ordered by prestige value and, in case of a tie, by food value.
*/
public synchronized void EndGameForFeit() {
public synchronized void endGameForFeit() {
Player winner=playersList.stream().filter(x->!disconnetedPlayers.containsKey(x)||!disconnetedPlayers.get(x)).toList().get(0);
currentState.GameStageUpdate(GameStages.ENDED);
playerStanding=new ArrayList<>(playersList);