示例#1
0
        private void GoToStep(int step)
        {
            btnBack.Enabled = step > 0;

            currentStepIndex = step;
            if (step >= currentGame.Steps.Length)
            {
                btnNext.Enabled = false;
                return;
            }

            KillCurrentStep();

            Type[] steps = currentGame.Steps;

            Type s = steps[step];

            currentStep = (Control)Activator.CreateInstance(s);
            this.StepPanel.Controls.Add(currentStep);

            currentStep.Size = StepPanel.Size;

            currentInputStep = (IUserInputForm)currentStep;
            currentInputStep.Initialize(currentGameInfo, currentProfile);
            currentInputStep.Proceed += inputs_Proceed;

            label_StepTitle.Text = currentInputStep.Title;

            btnNext.Enabled = currentInputStep.CanPlay;
        }
示例#2
0
        private void GoToStep(int step)
        {
            btnBack.Enabled = step > 0;

            currentStepIndex = step;
            if (step >= currentGame.Steps.Length)
            {
                btnNext.Enabled = false;
                return;
            }

            KillCurrentStep();

            Type[] steps = currentGame.Steps;

            Type s = steps[step];
            currentStep = (Control)Activator.CreateInstance(s);
            this.StepPanel.Controls.Add(currentStep);

            currentStep.Size = StepPanel.Size;

            currentInputStep = (IUserInputForm)currentStep;
            currentInputStep.Initialize(currentGameInfo, currentProfile);
            currentInputStep.Proceed += inputs_Proceed;

            label_StepTitle.Text = currentInputStep.Title;

            btnNext.Enabled = currentInputStep.CanPlay;
        }