/// <summary> /// 不出牌结束回合,其他类使用 /// </summary> public void EndTurnPass() { if (turnStarted) { EndTurnCommon(); passCount += 1; if (passCount >= 2)//没人压牌,直接替换为None牌型 { CardManager.SetLastHand(CardSet.None); } } }
void Awake() { view = GetComponentInChildren <GameView>(); p1Manager = transform.Find("MainPlayer").GetComponent <MainPlayerManagerOffline>(); p1Manager.Init(CardManager.MainPlayerHand); p2Manager = transform.Find("Player2").GetComponent <OtherPlayerManagerOffline>(); p2Manager.Init(CardManager.Player2Hand, 2); p3Manager = transform.Find("Player3").GetComponent <OtherPlayerManagerOffline>(); p3Manager.Init(CardManager.Player3Hand, 3); EventCenter.AddListener(EventType.TestEvent, Test); EventCenter.AddListener(EventType.MatchExit, ReturnToLobby); EventCenter.AddListener(EventType.MatchReset, MatchReset); EventCenter.AddListener(EventType.DealCardOver, DealCardOver); CardManager.SetLastHand(CardSet.None); StartDealCard(); }
/// <summary> /// 开始一局新游戏 /// </summary> private void MatchReset() { view.MatchReset(); p1Manager.MatchReset(); p2Manager.MatchReset(); p3Manager.MatchReset(); turnStarted = false; turnEnded = true; turnEnabled = false; passCount = 0; noGrabLandlordPlayerCount = 0; grabLandlordPlayerCount = 0; lastGrabLandlordPlayer = 0; startPlayer = lastWinner; currentPlayer = startPlayer; landlordPlayer = 0; CardManager.SetLastHand(CardSet.None); StartDealCard(); }