Ejemplo n.º 1
0
        public void NewTurn(DominionBase.Players.Player player, DominionBase.Cards.Card grantedBy)
        {
            Utilities.Log(this.LogFile, "-------------------------------------------------------");

            if (_CurrentPlayerTurn != null)
            {
                _CurrentPlayerTurn.End();
            }

            _CurrentPlayerTurn         = new ucPlayerTurn();
            _CurrentPlayerTurn.LogFile = this.LogFile;
            if (player != null)
            {
                _CurrentPlayerTurn.New(player, this.PlayerBrushes[player.Name], grantedBy);
            }

            if (_CurrentGameTurn != null)
            {
                (_CurrentGameTurn as ucGameTurn).Add(_CurrentPlayerTurn as ucPlayerTurn);

                if (wMain.Settings.AutoCollapseOldTurns)
                {
                    IEnumerable <ucGameTurn> gameTurns = spArea.Children.OfType <ucGameTurn>();
                    if (gameTurns.Count() > 1)
                    {
                        ucGameTurn gtOld = gameTurns.ElementAt(gameTurns.Count() - 2);
                        foreach (ucPlayerTurn pt in gtOld.GetChildren(player))
                        {
                            pt.IsExpanded = false;
                        }
                        if (!gtOld.IsAnyExpanded)
                        {
                            gtOld.IsAllExpanded = true;
                            gtOld.IsExpanded    = false;
                        }
                    }
                }
            }
            else
            {
                spArea.Children.Add(_CurrentPlayerTurn);
            }

            svArea.ScrollToBottom();
            svArea.ScrollToLeftEnd();
        }
Ejemplo n.º 2
0
        public void NewSection(String title)
        {
            Utilities.Log(this.LogFile, "-------------------------------------------------------");

            if (_CurrentPlayerTurn != null)
            {
                _CurrentPlayerTurn.End();
            }

            _CurrentPlayerTurn         = new ucGameMessage();
            _CurrentPlayerTurn.LogFile = this.LogFile;
            _CurrentPlayerTurn.New(title);

            spArea.Children.Add(_CurrentPlayerTurn);
            svArea.ScrollToBottom();
            svArea.ScrollToLeftEnd();
        }