@@ -0,0 +1,2183 @@
+package com.apixandru.rummikub.client.game;%0A%0Aimport com.apixandru.games.rummikub.api.Card;%0Aimport com.apixandru.games.rummikub.api.Player;%0Aimport com.apixandru.games.rummikub.brotocol.PacketWriter;%0Aimport com.apixandru.games.rummikub.brotocol.game.client.PacketEndTurn;%0Aimport com.apixandru.games.rummikub.brotocol.game.client.PacketMoveCard;%0Aimport com.apixandru.games.rummikub.brotocol.game.client.PacketPlaceCard;%0Aimport com.apixandru.games.rummikub.brotocol.game.client.PacketTakeCard;%0A%0A/**%0A * @author Alexandru-Constantin Bledea%0A * @since January 04, 2016%0A */%0Afinal class SocketPlayer implements Player%3CInteger%3E %7B%0A%0A    private final PacketWriter writer;%0A    private final String playerName;%0A%0A    SocketPlayer(final String playerName, final PacketWriter writer) %7B%0A        this.writer = writer;%0A        this.playerName = playerName;%0A    %7D%0A%0A    private static int toInteger(final Integer hint) %7B%0A        if (null == hint) %7B%0A            return -1;%0A        %7D%0A        return hint;%0A    %7D%0A%0A    @Override%0A    public String getName() %7B%0A        return this.playerName;%0A    %7D%0A%0A    @Override%0A    public void placeCardOnBoard(final Card card, final int x, final int y) %7B%0A        final PacketPlaceCard packet = new PacketPlaceCard();%0A        packet.card = card;%0A        packet.x = x;%0A        packet.y = y;%0A        writer.writePacket(packet);%0A    %7D%0A%0A    @Override%0A    public void moveCardOnBoard(final Card card, final int fromX, final int fromY, final int toX, final int toY) %7B%0A        final PacketMoveCard packet = new PacketMoveCard();%0A        packet.card = card;%0A        packet.fromX = fromX;%0A        packet.fromY = fromY;%0A        packet.toX = toX;%0A        packet.toY = toY;%0A        writer.writePacket(packet);%0A    %7D%0A%0A    @Override%0A    public void takeCardFromBoard(final Card card, final int x, final int y, final Integer hint) %7B%0A        final PacketTakeCard packet = new PacketTakeCard();%0A        packet.card = card;%0A        packet.x = x;%0A        packet.y = y;%0A        packet.hint = toInteger(hint);%0A        writer.writePacket(packet);%0A    %7D%0A%0A    @Override%0A    public void endTurn() %7B%0A        final PacketEndTurn packet = new PacketEndTurn();%0A        writer.writePacket(packet);%0A    %7D%0A%0A%7D%0A

add new socket player