Source:
public ClientMap(GameDTO serverGame, BorderPane gameBox, Broker broker, BoDCharacter clientChar) { this.unassignedBullets = new ConcurrentLinkedQueue<>(); this.serverGameId = serverGame.getGameId(); this.clientChar = clientChar; this.clientChar.addObserver(this); if (clientChar.getWeapon() != null) { clientChar.getWeapon().addObserver(this); } mapActive = true; gameObjects = new ConcurrentHashMap<>(); addGameObject(clientChar); this.broker = broker; broker.activate(this); timer = new Timer(); timer.start(); for (GameObjectDTO dto : serverGame.getGameObjects()) { if (dto.getBody().getType() == Body.Geometry.CIRCLE.ordinal()) { if (dto.getId() != clientChar.getId()) { addGameObject(EntityFactory.getEntity(dto, EntityFactory.EntityType.ENEMY_CHARACTER)); } } else if (dto.getBody().getType() == Body.Geometry.RECTANGLE.ordinal()) { addGameObject(EntityFactory.getEntity(dto, EntityFactory.EntityType.WALL)); } } for (PlayerDTO pdto : serverGame.getPlayers()) { BoDCharacter playerChar = (BoDCharacter)gameObjects.get(pdto.getId()); if(playerChar!= null) { playerChar.setNickname(pdto.getNickname()); } if(pdto.getId()==clientChar.getId()) { clientChar.setNickname(pdto.getNickname()); } } fpsLabel = new Label(); fpsLabel.setPrefSize(50, 20); fpsLabel.setText("fps: "); scoreLabel = new Label(); scoreLabel.setPrefSize(70, 20); scoreLabel.setText("Score: "); healthLabel = new Label(); healthLabel.setPrefSize(80, 20); healthLabel.setText("Health: "); labelBox = new VBox(); labelBox.setSpacing(1); gameBox.setLeft(labelBox); labelBox.getChildren().add(fpsLabel); labelBox.getChildren().add(scoreLabel); labelBox.getChildren().add(healthLabel); this.canvas = (Canvas)gameBox.getCenter(); gc = canvas.getGraphicsContext2D(); }

Target:
public ClientMap(GameDTO serverGame, BorderPane gameBox, Broker broker, BoDCharacter clientChar) { this.unassignedBullets = new ConcurrentLinkedQueue<>(); this.serverGameId = serverGame.getGameId(); this.clientChar = clientChar; this.clientChar.addObserver(this); if (clientChar.getWeapon() != null) { clientChar.getWeapon().addObserver(this); } mapActive = true; gameObjects = new ConcurrentHashMap<>(); addGameObject(clientChar); this.broker = broker; broker.activate(this); timer = new Timer(); timer.start(); for (GameObjectDTO dto : serverGame.getGameObjects()) { if (dto.getBody().getType() == Body.Geometry.CIRCLE.ordinal()) { if (dto.getId() != clientChar.getId()) { addGameObject(EntityFactory.getEntity(dto, EntityFactory.EntityType.ENEMY_CHARACTER)); } } else if (dto.getBody().getType() == Body.Geometry.RECTANGLE.ordinal()) { addGameObject(EntityFactory.getEntity(dto, EntityFactory.EntityType.WALL)); } } for (PlayerDTO pdto : serverGame.getPlayers()) { } fpsLabel = new Label(); fpsLabel.setPrefSize(50, 20); fpsLabel.setText("fps: "); scoreLabel = new Label(); scoreLabel.setPrefSize(70, 20); scoreLabel.setText("Score: "); healthLabel = new Label(); healthLabel.setPrefSize(80, 20); healthLabel.setText("Health: "); labelBox = new VBox(); labelBox.setSpacing(1); gameBox.setLeft(labelBox); labelBox.getChildren().add(fpsLabel); labelBox.getChildren().add(scoreLabel); labelBox.getChildren().add(healthLabel); this.canvas = (Canvas)gameBox.getCenter(); gc = canvas.getGraphicsContext2D(); }