Пример #1
0
        public override void OnClientStateEnter()
        {
            // update local tiles
            CurrentRoundStatus.NewRound(OyaPlayerIndex, Dice, Field, Extra, RichiSticks);
            CurrentRoundStatus.SetMahjongSetData(MahjongSetData);
            CurrentRoundStatus.CheckLocalHandTiles(LocalPlayerHandTiles);
            CurrentRoundStatus.SetZhenting(false);
            // update other player's hand tile count
            for (int placeIndex = 0; placeIndex < 4; placeIndex++)
            {
                int playerIndex = CurrentRoundStatus.GetPlayerIndex(placeIndex);
                if (playerIndex < CurrentRoundStatus.TotalPlayers)
                {
                    CurrentRoundStatus.SetHandTiles(placeIndex, LocalPlayerHandTiles.Count);
                }
                else
                {
                    CurrentRoundStatus.SetHandTiles(placeIndex, 0);
                }
            }
            // sync points
            CurrentRoundStatus.UpdatePoints(Points);
            // update ui statement
            var controller = ViewController.Instance;

            // reset yama
            controller.YamaManager.ResetAllTiles();
            // stand hand tiles
            controller.TableTilesManager.StandUp();
            // clear claimed open melds
            controller.TableTilesManager.ClearMelds();
            // send ready message
            ClientBehaviour.Instance.ClientReady();
        }
 private void SetRoundStatusData()
 {
     CurrentRoundStatus.CheckLocalHandTiles(HandData.HandTiles);
     CurrentRoundStatus.SetMahjongSetData(MahjongSetData);
     SetRiverData();
     CurrentRoundStatus.CalculatePossibleWaitingTiles();
     CurrentRoundStatus.SetForbiddenTiles(Operation.ForbiddenTiles);
 }
Пример #3
0
        private void HandleLocalPlayerKong()
        {
            CurrentRoundStatus.SetCurrentPlaceIndex(KongPlayerIndex);
            int placeIndex = CurrentRoundStatus.CurrentPlaceIndex;

            Assert.IsTrue(placeIndex == 0);
            CurrentRoundStatus.CheckLocalHandTiles(HandData.HandTiles);
            CurrentRoundStatus.ClearLastDraws();
            CurrentRoundStatus.SetMahjongSetData(MahjongSetData);
            controller.TableTilesManager.SetMelds(placeIndex, HandData.OpenMelds);
            ClientBehaviour.Instance.OnSkipOutTurnOperation(BonusTurnTime);
            controller.ShowEffect(placeIndex, PlayerEffectManager.Type.Kong);
        }
        private void HandleOtherDiscard()
        {
            CurrentRoundStatus.SetCurrentPlaceIndex(CurrentPlayerIndex);
            int placeIndex = CurrentRoundStatus.CurrentPlaceIndex;

            // update hand tiles
            CurrentRoundStatus.CheckLocalHandTiles(HandTiles);
            CurrentRoundStatus.SetZhenting(Zhenting);
            if (IsRichiing)
            {
                controller.ShowEffect(placeIndex, PlayerEffectManager.Type.Richi);
            }
            controller.StartCoroutine(UpdateHandData(placeIndex, DiscardingLastDraw, Tile, Rivers));
        }
 private void HandleLocalDiscard()
 {
     // if local, check data accuracy, including hand tiles and river tiles
     // check hand tiles
     CurrentRoundStatus.CheckLocalHandTiles(HandTiles);
     // set river tiles
     for (int playerIndex = 0; playerIndex < Rivers.Length; playerIndex++)
     {
         int placeIndex = CurrentRoundStatus.GetPlaceIndex(playerIndex);
         CurrentRoundStatus.SetRiverData(placeIndex, Rivers[playerIndex]);
     }
     // set zhenting status
     CurrentRoundStatus.SetZhenting(Zhenting);
     // skipping this out turn operation, since the current turn is the turn of local player.
     ClientBehaviour.Instance.OnSkipOutTurnOperation(BonusTurnTime);
 }