Ejemplo n.º 1
0
        public void CreateUNOGame(int playersNumber, string[] names)
        {
            if (playersNumber > 0)
            {
                initialized   = true;
                playerCount   = playersNumber;
                playersHeader = OneGamePlayers.CreateGameHeader(playersNumber, names);
                playersHeader.NameChangedEvent += new EventHandler <NameChangedEventArgs>(playersHeader_NameChangedEvent);

                this.Controls.Add(playersHeader);

                resultsControl = OneGameResultsCtrl.CreateGameResults(playersNumber);
                this.Controls.Add(resultsControl);

                RecalcPositions();
                this.Height = RowHeight * playerCount + ColumnHeaderHeight + BottomHeight + hScrollBar1.Height;
            }
        }
Ejemplo n.º 2
0
        public static OneGameResultsCtrl CreateGameResults(int playersCount)
        {
            OneGameResultsCtrl oneGameResults = null;

            if (playersCount > 0)
            {
                oneGameResults        = new OneGameResultsCtrl();
                oneGameResults.Height = UNOOneGame.RowHeight * playersCount + UNOOneGame.ColumnWidth;
                oneGameResults.Width  = UNOOneGame.TailWidth;
                for (int i = 0; i < playersCount; i++)
                {
                    ResultCellCtrl rcc = new ResultCellCtrl();
                    oneGameResults.allResults.Add(rcc);
                    rcc.Location = new Point(0, i * UNOOneGame.RowHeight + UNOOneGame.ColumnHeaderHeight);
                    rcc.Size     = new Size(UNOOneGame.TailWidth, UNOOneGame.RowHeight);
                    oneGameResults.Controls.Add(rcc);
                }
            }
            return(oneGameResults);
        }