From 2e71d6dff14728dfb94daaa18628eaa998e0a586 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 8 Nov 2018 21:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ratel/landlords/helper/RoomHelper.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 landlords-common/src/main/java/org/nico/ratel/landlords/helper/RoomHelper.java diff --git a/landlords-common/src/main/java/org/nico/ratel/landlords/helper/RoomHelper.java b/landlords-common/src/main/java/org/nico/ratel/landlords/helper/RoomHelper.java deleted file mode 100644 index f1eec7e..0000000 --- a/landlords-common/src/main/java/org/nico/ratel/landlords/helper/RoomHelper.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.nico.ratel.landlords.server.event.helper; - -import java.util.LinkedList; -import java.util.List; - -import org.nico.noson.Noson; -import org.nico.ratel.landlords.channel.ChannelUtils; -import org.nico.ratel.landlords.entity.ClientSide; -import org.nico.ratel.landlords.entity.Poker; -import org.nico.ratel.landlords.entity.Room; -import org.nico.ratel.landlords.enums.ClientEventCode; -import org.nico.ratel.landlords.enums.ClientType; -import org.nico.ratel.landlords.enums.RoomStatus; - -/** - * - * @author nico - */ - -public class RoomHelper { - - public static void restartingGame(Room room){ - LinkedList roomClientList = room.getClientSideList(); - - // Push start game messages - room.setStatus(RoomStatus.STARTING); - for(ClientSide client: roomClientList) { - client.setType(ClientType.PEASANT); - ChannelUtils.pushToClient(client.getChannel(), ClientEventCode.CODE_ROOM_STARTING, Noson.reversal(room)); - } - - TimeHelper.sleep(500); - - // Send the points of poker - List> pokersList = PokerHelper.distributePoker(); - int cursor = 0; - for(ClientSide client: roomClientList){ - client.setPokers(pokersList.get(cursor ++)); - ChannelUtils.pushToClient(client.getChannel(), ClientEventCode.CODE_SHOW_POKERS, PokerHelper.unfoldPoker(client.getPokers(), false)); - } - room.setLandlordPokers(pokersList.get(3)); - - TimeHelper.sleep(500); - - // Push information about the robber - int startGrabIndex = (int)(Math.random() * 3); - ClientSide startGrabClient = roomClientList.get(startGrabIndex); - room.setLandlordId(startGrabClient.getId()); - - for(ClientSide client: roomClientList){ - if(client.getId() == startGrabClient.getId()){ - ChannelUtils.pushToClient(client.getChannel(), ClientEventCode.CODE_GRAB_LANDLORD, null); - }else{ - ChannelUtils.pushToClient(client.getChannel(), null, "Wait for " + startGrabClient.getNickname() + " verify local owner"); - } - } - - } - -}