Пример #1
0
        private void DrawInitial()
        {
            for (int round = 0; round < MahjongConstants.InitialDrawRound; round++)
            {
                // Draw 4 tiles for each player
                for (int index = 0; index < players.Count; index++)
                {
                    for (int i = 0; i < MahjongConstants.TilesEveryRound; i++)
                    {
                        var tile = MahjongSet.DrawTile();
                        CurrentRoundStatus.AddTile(index, tile);
                    }
                }
            }

            // Last round, 1 tile for each player
            for (int index = 0; index < players.Count; index++)
            {
                for (int i = 0; i < MahjongConstants.TilesLastRound; i++)
                {
                    var tile = MahjongSet.DrawTile();
                    CurrentRoundStatus.AddTile(index, tile);
                }
            }
        }
Пример #2
0
        private void UpdateRoundStatus()
        {
            var lastDraw = (Tile)CurrentRoundStatus.LastDraw;

            CurrentRoundStatus.LastDraw = null;
            CurrentRoundStatus.AddTile(CurrentPlayerIndex, lastDraw);
            CurrentRoundStatus.RemoveTile(CurrentPlayerIndex, new Tile(Suit.Z, 4));
            CurrentRoundStatus.AddBeiDoras(CurrentPlayerIndex);
            CurrentRoundStatus.SortHandTiles();
        }
Пример #3
0
        private void UpdateRoundStatus()
        {
            CurrentRoundStatus.SetBonusTurnTime(CurrentPlayerIndex, BonusTurnTime);
            var lastDraw = CurrentRoundStatus.LastDraw;

            CurrentRoundStatus.LastDraw = null;
            if (!DiscardLastDraw)
            {
                CurrentRoundStatus.RemoveTile(CurrentPlayerIndex, DiscardTile);
                if (lastDraw != null)
                {
                    CurrentRoundStatus.AddTile(CurrentPlayerIndex, (Tile)lastDraw);
                }
            }
            CurrentRoundStatus.AddToRiver(CurrentPlayerIndex, DiscardTile, IsRichiing);
            CurrentRoundStatus.SortHandTiles();
            CurrentRoundStatus.UpdateDiscardZhenting();
        }
Пример #4
0
        private void UpdateRoundStatus()
        {
            var lastDraw = (Tile)CurrentRoundStatus.LastDraw;

            CurrentRoundStatus.LastDraw = null;
            CurrentRoundStatus.AddTile(CurrentPlayerIndex, lastDraw);
            if (Kong.IsAdded) // add kong
            {
                CurrentRoundStatus.AddKong(CurrentPlayerIndex, Kong);
                CurrentRoundStatus.RemoveTile(CurrentPlayerIndex, Kong.Extra);
            }
            else // self kong
            {
                CurrentRoundStatus.AddMeld(CurrentPlayerIndex, Kong);
                CurrentRoundStatus.RemoveTile(CurrentPlayerIndex, Kong);
            }
            CurrentRoundStatus.SortHandTiles();
            // turn dora if this is a self kong
            if (Kong.Side == MeldSide.Self)
            {
                MahjongSet.TurnDora();
            }
        }