//判断出完这次牌后,下一次能不能一次出完 private static bool afterThisOut_CanOutAllCard(List <Card> people, List <Card> thisCard) { //如果当前已经可以打完了,返回true if (people.Count == thisCard.Count) { return(true); } //保存当前的卡组 List <Card> tDeck = Card.CopyListCard(people); //一出当前要出的牌 for (int i = 0; i < thisCard.Count; i++) { tDeck.Remove(thisCard[i]); } //更新卡组的数量 PeopleOperator.updateCardNum(tDeck); //判断下一次出牌 //找同类型自己能出的最小的牌(不能随便拆) People p = new People(); p.deck = tDeck; p.htStyle = OutCardStyleEnum.CANT_OUT; //利用玩家的提示 PlayerRemindCard.peopleFirstHint(p, false); //如果该玩家提示的牌可全部出完 return(p.htCards.Count == tDeck.Count); }
public const int MAX_RE_CALLSCORE_NUM = 3; //最大可以重新开始叫分的次数 //对游戏大厅做销毁处理 public void destroyGameProcessDeal() { lobby = null; for (int i = 0; i < 4; i++) { peoples[i] = null; outCards = null; } peopleOperator = null; cardPile = null; random = null; timeCount = null; fourCallScore = null; }
//将卡组信息转换为Card数组 public static List <Card> jsonToCards(string cardsMsg) { List <Card> resCards = new List <Card>(); //先将string转为byte byte[] cardByte = Encoding.UTF8.GetBytes(cardsMsg); for (int i = 0; i < cardByte.Length; i++) { resCards.Add(Landlord_GameMode.ConvertCard(cardByte[i])); } //更新卡组卡的数量 PeopleOperator.updateCardNum(resCards); return(resCards); }
//将游戏大厅传入,因为游戏是对四个人通信 public GameProcess(GameLobby lobby) { this.lobby = lobby; random = new Random(); peopleOperator = new PeopleOperator(new Landlord_GameMode()); firstCallScore = -1; intergation = 0; whoIsLand = -1; timeCount = new Stopwatch(); fourCallScore = new int[4] { -1, -1, -1, -1 }; startCallScore = false; startOutCard = false; reCallScoreNum = 0; }