mirror of
https://github.com/tiennm99/caro.git
synced 2026-05-24 04:24:23 +00:00
是否抢取地主决策方法修改
This commit is contained in:
+3
-1
@@ -17,7 +17,9 @@ public class RobotDecisionMakers {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean howToChooseLandlord(List<Poker> leftPokers, List<Poker> rightPokers, List<Poker> landlordPokers, List<Poker> myPokers) {
|
||||
public static boolean howToChooseLandlord(List<Poker> leftPokers, List<Poker> rightPokers, List<Poker> myPokers) {
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+20
-1
@@ -1,11 +1,16 @@
|
||||
package org.nico.ratel.landlords.server.robot;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.ServerEventCode;
|
||||
import org.nico.ratel.landlords.helper.MapHelper;
|
||||
import org.nico.ratel.landlords.helper.PokerHelper;
|
||||
import org.nico.ratel.landlords.robot.RobotDecisionMakers;
|
||||
import org.nico.ratel.landlords.server.ServerContains;
|
||||
import org.nico.ratel.landlords.server.event.ServerEventListener;
|
||||
@@ -21,7 +26,21 @@ public class RobotEventListener_CODE_GAME_LANDLORD_ELECT implements RobotEventLi
|
||||
int turnClientId = (int) map.get("nextClientId");
|
||||
|
||||
if(turnClientId == robot.getId()) {
|
||||
ServerEventListener.get(ServerEventCode.CODE_GAME_LANDLORD_ELECT).call(robot, String.valueOf(RobotDecisionMakers.howToChooseLandlord(robot.getPre().getPokers(), robot.getNext().getPokers(), room.getLandlordPokers(), robot.getPokers())));
|
||||
List<Poker> landlordPokers = new ArrayList<>(20);
|
||||
landlordPokers.addAll(robot.getPokers());
|
||||
landlordPokers.addAll(room.getLandlordPokers());
|
||||
|
||||
List<Poker> leftPokers = new ArrayList<>(17);
|
||||
leftPokers.addAll(robot.getPre().getPokers());
|
||||
|
||||
List<Poker> rightPokers = new ArrayList<>(17);
|
||||
leftPokers.addAll(robot.getNext().getPokers());
|
||||
|
||||
PokerHelper.sortPoker(landlordPokers);
|
||||
PokerHelper.sortPoker(leftPokers);
|
||||
PokerHelper.sortPoker(rightPokers);
|
||||
|
||||
ServerEventListener.get(ServerEventCode.CODE_GAME_LANDLORD_ELECT).call(robot, String.valueOf(RobotDecisionMakers.howToChooseLandlord(leftPokers, rightPokers, landlordPokers)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user