/// <summary> /// 轮到下一个玩家表态 /// </summary> private void MoveToNextSeat(decimal amount, bool isLook, int playerId, EChipinType chipinType = EChipinType.Nothing) { lock (this) { PreSeatAmount = amount; if (chipinType != EChipinType.GaveUp) { CurrentSeat.PreChipInAmount = amount; CurrentSeat.PreChipType = chipinType; AddCurrentTotal(amount); } Seat tempSeat = CurrentSeat; do { tempSeat = GetNextJoinSeat(tempSeat); } while (tempSeat.IsGaveUp); CurrentSeat = tempSeat; PreSeatIsLook = isLook; if (CurrentSeat == FirstSeat) { CurrentTurn++; } if (CurrentTurn > DefaultTurnCount) { NotifyRoomPlayers(WebscoketSendObjs.RoomMessage(0, "超过最大轮次,自动比牌")); CompareAll(); } if (JoinSeats.Where(s => s.IsGaveUp == false).Count() == 1) { CompareAll(); } } CheckDateTime = DateTime.Now; NotifyRoomPlayers(new ChipinAnimation(0, amount, playerId, chipinType)); NotifyRoomPlayers(new FreshGameFace(0)); }
public bool ChipIn(decimal amount, Func <IPlayerJoinRoom, decimal, bool> DDecutMoney, EChipinType chipType) { if (chipType == EChipinType.NoLook && this.IsLooked) { return(false); } if (DDecutMoney(this.IPlayer, amount)) { PreChipInAmount = amount; PreChipType = chipType; return(true); } return(false); }
public void ChipInFollow(int playerId) { Seat seat = GetJionSeatByPlayerId(playerId); if (IsNotPassedCheck(seat)) { return; } bool iHadLook = seat.IsLooked; decimal chipInAmount = PreSeatAmount; if (iHadLook != PreSeatIsLook) { if (PreSeatIsLook) { chipInAmount = chipInAmount / 2; } else { chipInAmount = chipInAmount * 2; } } if (chipInAmount > LimitAmount) { chipInAmount = LimitAmount; } EChipinType chipType = EChipinType.Nothing; if (iHadLook) { chipType = EChipinType.Follow; } else { chipType = EChipinType.NoLook; } if (seat.ChipIn(chipInAmount, IsDecutMoneySuccess, chipType)) { MoveToNextSeat(chipInAmount, iHadLook, playerId, chipType); } }
public ChipinAnimation(int playerId, decimal amount, int forPlayerId, EChipinType chipinType = EChipinType.Nothing, string clientMethodName = "ChipinAnimation") : base(playerId, clientMethodName) { ChipinType = chipinType; Amount = amount; ForPlayerId = forPlayerId; }