예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Info"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Info(Game.Game g)
        {
            this.Label       = "Score";
            this.BorderWidth = 5;
            this.game        = g;

            this.HeightRequest = 99;
            this.WidthRequest  = 120;

            scoresTable = new Gtk.Table(6, 2, true);
            scoreValues = new Gtk.Label[6 * 2];
            for (int i = 0; i < this.game.players.Length; i++)
            {
                scoreValues[i]     = new Label(game.players[i].Name);
                scoreValues[i + 6] = new Label("0");
                scoresTable.Attach(scoreValues[i], 0, 1, (uint)i, (uint)i + 1);
                scoresTable.Attach(scoreValues[i + 6], 1, 2, (uint)i, (uint)i + 1);
            }
            for (int i = this.game.players.Length; i < 6; i++)
            {
                scoreValues[i]     = new Label( );
                scoreValues[i + 6] = new Label( );
                scoresTable.Attach(scoreValues[i], 0, 1, (uint)i, (uint)i + 1);
                scoresTable.Attach(scoreValues[i + 6], 1, 2, (uint)i, (uint)i + 1);
            }
            scoresTable.BorderWidth = 3;
            this.Add(scoresTable);

            this.ShowAll();
        }
예제 #2
0
파일: info.cs 프로젝트: Kedrigern/scrabble
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Info"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Info(Game.Game g)
        {
            this.Label = "Score";
            this.BorderWidth = 5;
            this.game = g;

            this.HeightRequest = 99;
            this.WidthRequest = 120;

            scoresTable = new Gtk.Table( 6, 2, true );
            scoreValues = new Gtk.Label[ 6*2 ];
            for( int i=0; i < this.game.players.Length; i++) {
                scoreValues[ i ] = new Label( game.players[i].Name );
                scoreValues[ i+6 ] = new Label( "0" );
                scoresTable.Attach( scoreValues[i], 0 , 1, (uint) i, (uint) i+1);
                scoresTable.Attach( scoreValues[i+6] , 1, 2, (uint) i, (uint) i+1 );
            }
            for( int i=this.game.players.Length; i < 6; i++) {
                scoreValues[ i ] = new Label( );
                scoreValues[ i+6 ] = new Label( );
                scoresTable.Attach( scoreValues[i], 0 , 1, (uint) i, (uint) i+1);
                scoresTable.Attach( scoreValues[i+6] , 1, 2, (uint) i, (uint) i+1 );
            }
            scoresTable.BorderWidth = 3;
            this.Add( scoresTable );

            this.ShowAll();
        }
예제 #3
0
 public void SetGame( Game.Game g )
 {
     this.game = g;
 }