Example #1
0
        // Button reset handler
        private void buttonReset_Click(object sender, EventArgs e)
        {
            if (programState == ProgramState.init)
            {
                buttonChangeGameState.Text = "Begin battle!";
                setStatusLabel();


                // Reset ally field
                fieldAlly.Reset();

                // Init buttons for ship chosing
                GameInit.SetInitButtons(groupBoxInit, fieldAlly);
                ShipButton.active = false;
            }
        }
Example #2
0
        void InitProgramm()
        {
            buttonChangeGameState.Text = "Begin battle!";
            setStatusLabel();

            // Open addition buttons
            buttonReset.Visible      = true;
            buttonFillRandom.Visible = true;

            // Init field
            fieldEnemy.Init(fieldSize, Player.enemy);
            fieldAlly.Init(fieldSize, Player.ally);


            // Init buttons for ship chosing
            GameInit.SetInitButtons(groupBoxInit, fieldAlly);
        }