refactor: changed public final variables to getters
This commit is contained in:
		| @ -18,10 +18,10 @@ import uulm.teamname.marvelous.server.lobbymanager.Participant; | |||||||
| import java.util.*; | import java.util.*; | ||||||
|  |  | ||||||
| public class Lobby { | public class Lobby { | ||||||
|     public final String gameID; |     private final String gameID; | ||||||
|     public final LobbyConnection connection; |     private final LobbyConnection connection; | ||||||
|     public final GameInstance game; |     private final GameInstance game; | ||||||
|     public final Pipeline pipeline; |     private final Pipeline pipeline; | ||||||
|     private Participant activePlayer; |     private Participant activePlayer; | ||||||
|     private int badRequests; |     private int badRequests; | ||||||
|     private PauseSegment pauseSegment; |     private PauseSegment pauseSegment; | ||||||
| @ -176,4 +176,24 @@ public class Lobby { | |||||||
|     public PauseSegment getPauseSegment() { |     public PauseSegment getPauseSegment() { | ||||||
|         return pauseSegment; |         return pauseSegment; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public String getGameID() { | ||||||
|  |         return gameID; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public LobbyConnection getConnection() { | ||||||
|  |         return connection; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public GameInstance getGame() { | ||||||
|  |         return game; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public Pipeline getPipeline() { | ||||||
|  |         return pipeline; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public Participant getActivePlayer() { | ||||||
|  |         return activePlayer; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -23,14 +23,14 @@ public class DisconnectSegment implements Segment { | |||||||
|         Logger.trace("DisconnectSegment received {} requests.", packet.size()); |         Logger.trace("DisconnectSegment received {} requests.", packet.size()); | ||||||
|         if (packet.containsRequestOfType(RequestType.DisconnectRequest)) { |         if (packet.containsRequestOfType(RequestType.DisconnectRequest)) { | ||||||
|             Logger.debug("Player of Type {} sent DisconnectRequest", packet.getOrigin().type); |             Logger.debug("Player of Type {} sent DisconnectRequest", packet.getOrigin().type); | ||||||
|             parent.connection.removePlayer(packet.getOrigin()); |             parent.getConnection().removePlayer(packet.getOrigin()); | ||||||
|  |  | ||||||
|             if (packet.getOrigin().type != ParticipantType.Spectator) { |             if (packet.getOrigin().type != ParticipantType.Spectator) { | ||||||
|                 if(parent.connection.hasPlayer1()){ |                 if(parent.getConnection().hasPlayer1()){ | ||||||
|                     parent.generateWin(parent.connection.getPlayer1()); |                     parent.generateWin(parent.getConnection().getPlayer1()); | ||||||
|                 } |                 } | ||||||
|                 else if(parent.connection.hasPlayer2()) { |                 else if(parent.getConnection().hasPlayer2()) { | ||||||
|                     parent.generateWin(parent.connection.getPlayer2()); |                     parent.generateWin(parent.getConnection().getPlayer2()); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             packet.clear(); |             packet.clear(); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user