Package server.commands.methods

Source Code of server.commands.methods.SendSheet

package server.commands.methods;

import java.io.IOException;
import java.util.Iterator;

import org.quickserver.net.server.ClientHandler;

import server.protocol.GameRoom;

/**
* The Class SendSheet. Handles sending the gamesheet.
*/
public class SendSheet {

  /**
   * Sends the gamesheet.
   *
   * @param handler the handler
   * @param room the room
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public void send(ClientHandler handler, GameRoom room) throws IOException {
    Iterator<ClientHandler> iterator = room.getClients().iterator();
    ClientHandler toHandler = null;
    while (iterator.hasNext()) {
      toHandler = (ClientHandler) iterator.next();
      toHandler.getObjectOutputStream().reset();
      toHandler.sendClientObject(room.getGameSheet());

    }
  }
}
TOP

Related Classes of server.commands.methods.SendSheet

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.