package server.commands;
import java.io.IOException;
import java.util.List;
import org.quickserver.net.server.ClientHandler;
import server.constants.Messages;
import server.protocol.ClientInfo;
import server.protocol.GameRoom;
/**
* The Class Roll. Handles the roll command and sends the dice and message to
* clients.
*/
public class Roll implements Command {
public void execute(ClientHandler handler, GameRoom room,
List<String> splitted) throws IOException {
ClientInfo data = (ClientInfo) handler.getClientData();
room.getDice().rollDice();
methods.sendDice(handler, room);
methods.sendMessage(handler, room, Messages.ROLLMSG(data.getName(),
room.getDice().getDiceValuesString()));
}
}