Package server.commands

Source Code of server.commands.Roll

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()));
  }

}
TOP

Related Classes of server.commands.Roll

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.