Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var clientForm = new ClientForm();

            new TetrisClient(clientForm);
            Application.Run(clientForm);
        }
Example #2
0
        public TetrisClient(ClientForm form)
        {
            //Bind form and label
            clientForm  = form;
            ServerLabel = clientForm.getServerLabel();
            mpButton    = clientForm.getRadioButton();
            readyButton = clientForm.getReadyButton();

            //mpButton
            mpButton.CheckedChanged += (sender, args) => switchMultiplayer((RadioButton)sender);

            //ready button
            readyButton.Click += (sender, args) => readyUp();

            //Set server label
            ServerLabel.Text = "State: Disconnected";
        }