Esempio n. 1
0
        // Resets and refills every panels at a new round.
        private void NewRoundRefresh()
        {
            LblWallTilesLeft.Foreground  = System.Windows.Media.Brushes.Black;
            _game.Round.NotifyWallCount += OnNotifyWallCount;
            _game.Round.NotifyPick      += delegate(TileEventArgs e)
            {
                if (Properties.Settings.Default.PlaySounds)
                {
                    _tickSound.Play();
                }
                if (e != null)
                {
                    Dispatcher.Invoke(() =>
                    {
                        FillHandPanel(e.PlayerIndex, e.Tile);
                    });
                }
            };
            OnNotifyWallCount(null, null);

            StpDoras.SetDorasPanel(_game.Round.DoraIndicatorTiles, _game.Round.VisibleDorasCount);
            LblDominantWind.Content  = _game.DominantWind.ToWindDisplay();
            LblEastTurnCount.Content = $"{_game.EastRank}/{_game.HonbaCount}";
            for (int pIndex = 0; pIndex < _game.Players.Count; pIndex++)
            {
                this.FindPanel("StpCombosP", pIndex).Children.Clear();
                FillHandPanel(pIndex);
                FillDiscardPanel(pIndex);
                this.FindControl("LblWindP", pIndex).Content   = _game.GetPlayerCurrentWind(pIndex).ToString();
                this.FindControl("LblNameP", pIndex).Content   = _game.Players.ElementAt(pIndex).Name;
                this.FindControl("LblPointsP", pIndex).Content = $"{_game.Players.ElementAt(pIndex).Points / 1000}k";
            }
            SetPlayersLed();
            SetActionButtonsVisibility(preDiscard: true);
        }
Esempio n. 2
0
 // Common trunk of the kan call process.
 private void CommonCallKan(int?previousPlayerIndex, TilePivot compensationTile)
 {
     Dispatcher.Invoke(() =>
     {
         if (previousPlayerIndex.HasValue)
         {
             FillDiscardPanel(previousPlayerIndex.Value);
         }
         FillCombinationStack(_game.Round.CurrentPlayerIndex);
         SetActionButtonsVisibility(cpuPlay: !_game.Round.IsHumanPlayer, preDiscard: _game.Round.IsHumanPlayer);
         StpDoras.SetDorasPanel(_game.Round.DoraIndicatorTiles, _game.Round.VisibleDorasCount);
     });
 }