Exemplo n.º 1
0
        /*
         * private void InitializeComponent()
         * {
         *  this.btnStart = new System.Windows.Forms.Button();
         *  this.cbxTurned = new System.Windows.Forms.CheckBox();
         *  this.btnClose = new System.Windows.Forms.Button();
         *  this.txtScore = new System.Windows.Forms.TextBox();
         *  //this.cbxTimer = new System.Windows.Forms.CheckBox();
         *  this.btnRotate = new System.Windows.Forms.Button();
         *  this.btnLower = new System.Windows.Forms.Button();
         *  this.btnLeft = new System.Windows.Forms.Button();
         *  this.btnRight = new System.Windows.Forms.Button();
         *  this.label1 = new System.Windows.Forms.Label();
         *  this.btnReset = new System.Windows.Forms.Button();
         *  this.label2 = new System.Windows.Forms.Label();
         *  this.txtInput = new System.Windows.Forms.TextBox();
         *  this.SuspendLayout();
         *  //
         *  // btnStart
         *  //
         *  this.btnStart.Location = new System.Drawing.Point(12, 12);
         *  this.btnStart.Name = "btnStart";
         *  this.btnStart.Size = new System.Drawing.Size(75, 23);
         *  this.btnStart.TabIndex = 0;
         *  this.btnStart.Text = "&Start";
         *  this.btnStart.UseVisualStyleBackColor = true;
         *  this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
         *  //
         *  // cbxTurned
         *  //
         *  this.cbxTurned.AutoSize = true;
         *  this.cbxTurned.Location = new System.Drawing.Point(642, 12);
         *  this.cbxTurned.Name = "cbxTurned";
         *  this.cbxTurned.Size = new System.Drawing.Size(56, 17);
         *  this.cbxTurned.TabIndex = 1;
         *  this.cbxTurned.Text = "turned";
         *  this.cbxTurned.UseVisualStyleBackColor = true;
         *  //
         *  // btnClose
         *  //
         *  this.btnClose.Location = new System.Drawing.Point(12, 41);
         *  this.btnClose.Name = "btnClose";
         *  this.btnClose.Size = new System.Drawing.Size(75, 23);
         *  this.btnClose.TabIndex = 3;
         *  this.btnClose.Text = "&Close";
         *  this.btnClose.UseVisualStyleBackColor = true;
         *  this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
         *  //
         *  // txtScore
         *  //
         *  this.txtScore.Location = new System.Drawing.Point(381, 44);
         *  this.txtScore.Name = "txtScore";
         *  this.txtScore.ReadOnly = true;
         *  this.txtScore.Size = new System.Drawing.Size(100, 20);
         *  this.txtScore.TabIndex = 4;
         *  //
         *  // cbxTimer
         *  //
         *  this.cbxTimer.AutoSize = true;
         *  this.cbxTimer.Location = new System.Drawing.Point(584, 12);
         *  this.cbxTimer.Name = "cbxTimer";
         *  this.cbxTimer.Size = new System.Drawing.Size(52, 17);
         *  this.cbxTimer.TabIndex = 6;
         *  this.cbxTimer.Text = "Timer";
         *  this.cbxTimer.UseVisualStyleBackColor = true;
         *  //
         *  // btnRotate
         *  //
         *  this.btnRotate.Location = new System.Drawing.Point(205, 12);
         *  this.btnRotate.Name = "btnRotate";
         *  this.btnRotate.Size = new System.Drawing.Size(75, 23);
         *  this.btnRotate.TabIndex = 7;
         *  this.btnRotate.Text = "Rotate";
         *  this.btnRotate.UseVisualStyleBackColor = true;
         *  this.btnRotate.Click += new System.EventHandler(this.btnRotate_Click);
         *  //
         *  // btnLower
         *  //
         *  this.btnLower.Location = new System.Drawing.Point(205, 41);
         *  this.btnLower.Name = "btnLower";
         *  this.btnLower.Size = new System.Drawing.Size(75, 23);
         *  this.btnLower.TabIndex = 8;
         *  this.btnLower.Text = "Lower";
         *  this.btnLower.UseVisualStyleBackColor = true;
         *  this.btnLower.Click += new System.EventHandler(this.btnLower_Click);
         *  //
         *  // btnLeft
         *  //
         *  this.btnLeft.Location = new System.Drawing.Point(124, 41);
         *  this.btnLeft.Name = "btnLeft";
         *  this.btnLeft.Size = new System.Drawing.Size(75, 23);
         *  this.btnLeft.TabIndex = 9;
         *  this.btnLeft.Text = "Left";
         *  this.btnLeft.UseVisualStyleBackColor = true;
         *  this.btnLeft.Click += new System.EventHandler(this.btnLeft_Click);
         *  //
         *  // btnRight
         *  //
         *  this.btnRight.Location = new System.Drawing.Point(286, 41);
         *  this.btnRight.Name = "btnRight";
         *  this.btnRight.Size = new System.Drawing.Size(75, 23);
         *  this.btnRight.TabIndex = 10;
         *  this.btnRight.Text = "Right";
         *  this.btnRight.UseVisualStyleBackColor = true;
         *  this.btnRight.Click += new System.EventHandler(this.btnRight_Click);
         *  //
         *  // label1
         *  //
         *  this.label1.AutoSize = true;
         *  this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
         *  this.label1.Location = new System.Drawing.Point(381, 26);
         *  this.label1.Name = "label1";
         *  this.label1.Size = new System.Drawing.Size(37, 15);
         *  this.label1.TabIndex = 11;
         *  this.label1.Text = "Score";
         *  //
         *  // btnReset
         *  //
         *  this.btnReset.Location = new System.Drawing.Point(615, 42);
         *  this.btnReset.Name = "btnReset";
         *  this.btnReset.Size = new System.Drawing.Size(75, 23);
         *  this.btnReset.TabIndex = 12;
         *  this.btnReset.Text = "Reset";
         *  this.btnReset.UseVisualStyleBackColor = true;
         *  this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
         *  //
         *  // label2
         *  //
         *  this.label2.AutoSize = true;
         *  this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
         *  this.label2.Location = new System.Drawing.Point(487, 26);
         *  this.label2.Name = "label2";
         *  this.label2.Size = new System.Drawing.Size(32, 15);
         *  this.label2.TabIndex = 13;
         *  this.label2.Text = "input";
         *  //
         *  // txtInput
         *  //
         *  this.txtInput.Location = new System.Drawing.Point(487, 44);
         *  this.txtInput.Name = "txtInput";
         *  this.txtInput.Size = new System.Drawing.Size(100, 20);
         *  this.txtInput.TabIndex = 14;
         *  this.txtInput.TextChanged += new System.EventHandler(this.txtInput_TextChanged);
         *  //
         *  // TetrisServerControlsForm
         *  //
         *  this.ClientSize = new System.Drawing.Size(729, 608);
         *  this.Controls.Add(this.txtInput);
         *  this.Controls.Add(this.label2);
         *  this.Controls.Add(this.btnReset);
         *  this.Controls.Add(this.label1);
         *  this.Controls.Add(this.btnRight);
         *  this.Controls.Add(this.btnLeft);
         *  this.Controls.Add(this.btnLower);
         *  this.Controls.Add(this.btnRotate);
         * //            this.Controls.Add(this.cbxTimer);
         *  this.Controls.Add(this.txtScore);
         *  this.Controls.Add(this.btnClose);
         *  this.Controls.Add(this.cbxTurned);
         *  this.Controls.Add(this.btnStart);
         *  this.Name = "TetrisServerControlsForm";
         *  this.ResumeLayout(false);
         *  this.PerformLayout();
         *
         * }*/
        #endregion

        //constructor:
        public TetrisServerControlsForm(TetrisGame TetrisGameInput)
        {
            InitializeComponent();
            fillInBorders();
            tetrisgame = TetrisGameInput;
            //prevent flickering:
            this.DoubleBuffered = true;
            this.FormClosed    += new FormClosedEventHandler(TetrisServerControlsForm_FormClosed);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the node manager.
        /// </summary>
        public TetrisNodeManager(IServerInternal server, ApplicationConfiguration configuration)
            :
            base(server, configuration, Namespaces.Tetris)
        {
            SystemContext.NodeIdFactory = this;

            // get the configuration for the node manager.
            m_configuration = configuration.ParseExtension <TetrisServerConfiguration>();

            // use suitable defaults if no configuration exists.
            if (m_configuration == null)
            {
                m_configuration = new TetrisServerConfiguration();
            }

            //----------------- Initialize the Tetris Functionality --------------------
            m_TetrisSimulation   = new TetrisSimulation();
            m_TetrisGame         = new TetrisGame();
            m_TetrisControlsForm = new TetrisServerControlsForm(m_TetrisGame);
            m_TetrisControlsForm.Show();
            //--------------------------------------------------------------------------
        }