コード例 #1
0
ファイル: MainForm.cs プロジェクト: SyrnikovEK/csharp
        public void SwitchScene(Scene scene)
        {
            BaseUserControl ctrl = null;
            switch (scene)
            {
                case Scene.Autorization:
                    {
                        ctrl = new AutorizationUserControl();
                        break;
                    }
                case Scene.Combat:
                    {
                        ctrl = new CombatUserControl();
                        break;
                    }
                case Scene.Menu:
                    {
                        ctrl = new MenuUserControl();
                        break;
                    }
                case Scene.PlayerCreation:
                    {
                        ctrl = new PlayerCreationUserControl();
                        break;
                    }
                case Scene.RecordTable:
                    {
                        ctrl = new RecordTableUserControl();
                        break;
                    }
                case Scene.SecondPlayerLoad:
                    {
                        ctrl = new SecondPlayerLoadUserControl();
                        break;
                    }
                default:
                    {
                        break;
                    }
            }

            if (ctrl != null)
            {
                //this.Height = ctrl.Height + 20;
                //this.Width = ctrl.Width + 15;
                this.MinimumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                this.MaximumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                mainPanel.Height = ctrl.Height + 20;
                mainPanel.Width = ctrl.Width + 15;
                this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2);
                ctrl.Dock = DockStyle.Fill;
                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(ctrl);

            }
        }
コード例 #2
0
        public CombatScenePresenter(CombatUserControl view, AbstractPlayer player1, AbstractPlayer player2)
        {
            game = new GameControl(player1, player2);
            this.view = view;

            if (game.player2 is NPC)
            {
                gameType = GameType.PvE;
            }
            else
            {
                gameType = GameType.PvP;
            }
            DrawPlayersInfo();
        }
コード例 #3
0
        public CombatScenePresenter(CombatUserControl view, AbstractPlayer player1, AbstractPlayer player2)
        {
            game      = new GameControl(player1, player2);
            this.view = view;

            if (game.player2 is NPC)
            {
                gameType = GameType.PvE;
            }
            else
            {
                gameType = GameType.PvP;
            }
            DrawPlayersInfo();
        }
コード例 #4
0
        public void SwitchScene(Scene scene, object par1, object par2)
        {
            BaseUserControl ctrl = null;

            ctrl = new CombatUserControl(par1, par2);
            if (ctrl != null)
            {
                this.MinimumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                this.MaximumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                mainPanel.Height = ctrl.Height + 20;
                mainPanel.Width  = ctrl.Width + 15;
                this.Location    = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2);
                ctrl.Dock        = DockStyle.Fill;
                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(ctrl);
            }
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: SyrnikovEK/csharp
        public void SwitchScene(Scene scene, object par1 , object par2)
        {
            BaseUserControl ctrl = null;
            ctrl = new CombatUserControl(par1 , par2);
            if (ctrl != null)
            {
                this.MinimumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                this.MaximumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                mainPanel.Height = ctrl.Height + 20;
                mainPanel.Width = ctrl.Width + 15;
                this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2);
                ctrl.Dock = DockStyle.Fill;
                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(ctrl);

            }
        }
コード例 #6
0
        public void SwitchScene(Scene scene)
        {
            BaseUserControl ctrl = null;

            switch (scene)
            {
            case Scene.Autorization:
            {
                ctrl = new AutorizationUserControl();
                break;
            }

            case Scene.Combat:
            {
                ctrl = new CombatUserControl();
                break;
            }

            case Scene.Menu:
            {
                ctrl = new MenuUserControl();
                break;
            }

            case Scene.PlayerCreation:
            {
                ctrl = new PlayerCreationUserControl();
                break;
            }

            case Scene.RecordTable:
            {
                ctrl = new RecordTableUserControl();
                break;
            }

            case Scene.SecondPlayerLoad:
            {
                ctrl = new SecondPlayerLoadUserControl();
                break;
            }

            default:
            {
                break;
            }
            }



            if (ctrl != null)
            {
                //this.Height = ctrl.Height + 20;
                //this.Width = ctrl.Width + 15;
                this.MinimumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                this.MaximumSize = new Size(ctrl.Width + 15, ctrl.Height + 20);
                mainPanel.Height = ctrl.Height + 20;
                mainPanel.Width  = ctrl.Width + 15;
                this.Location    = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2);
                ctrl.Dock        = DockStyle.Fill;
                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(ctrl);
            }
        }