Exemplo n.º 1
0
        /// <summary>
        /// コンスとラクタ
        /// </summary>
        public GameDebugForm()
        {
            InitializeComponent();

            // 対戦チームリストの初期化
            InitializeTeamSetting();

            // 初期データ作成
            TeamSettingBuilder builder = new TeamSettingBuilder();
            InitializeData(TeamNumber.s000, TeamNumber.s000);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 現在の大会の進行度に適したCOMチームを取得する
        /// </summary>
        /// <returns>COMチームのチーム設定</returns>
        public static TeamSetting GetTeamSetting()
        {
            TeamNumber teamNumber;
            if (EVManager.Instance.IsReMatch)
            {
                // 再試合の場合は直前の相手と同じとする
                EVManager.Instance.IsReMatch = false;
                Assertion.Assert(EVManager.Instance.MatchUpTeamNumbers.Count > 0, "EVManager.Instance.MatchUpTeamNumbers.Count > 0");
                teamNumber = EVManager.Instance.MatchUpTeamNumbers.Last();
            }
            else
            {
                // 再試合でなければ進行度に応じた相手を取得する
                teamNumber = GetTeamNumber();
            }

            // チーム設定を作成して返す
            TeamSettingBuilder builder = new TeamSettingBuilder();
            TeamSetting enemyTeamSetting = builder.CreateTeamSetting(teamNumber);
            return enemyTeamSetting;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 試合管理クラスを作成して返す
        /// </summary>
        /// <param name="baseAbilityValue">ベース能力値</param>
        /// <returns>作成した試合管理クラス</returns>
        private GameManager GetGameManager(int baseAbilityValue)
        {
            // デバッグ用チーム設定
            TeamSettingBuilder builder = new TeamSettingBuilder();

            // 先行チームの設定
            TeamSetting topTeamSetting = builder.CreateTeamSetting("先行チーム", baseAbilityValue);
            {
                // 先頭打者の能力補正
                Player batter = topTeamSetting.CurrentPlayingMembers.First().Player;
                batter.FielderAbility.Meet += int.Parse(m_MeetValue1.Text);
                batter.FielderAbility.Power += int.Parse(m_PowerValue1.Text);
                batter.FielderAbility.Run += int.Parse(m_RunValue1.Text);
                batter.FielderAbility.Wisdom += int.Parse(m_WisdomValue1.Text);
                batter.FielderAbility.SpecialFilederAbility = SpecialAbilityHelper.GetSpecialFielderAbility(m_SpecialBattarAbility.Text);
            }

            // 後攻チームの設定
            TeamSetting bottomTeamSetting = builder.CreateTeamSetting("後攻チーム", baseAbilityValue);
            foreach (GameMember defenseMember in bottomTeamSetting.CurrentPlayingMembers)
            {
                // 守備メンバと投手の能力補正
                defenseMember.Player.FielderAbility.Run += int.Parse(m_RunValue2.Text);
                defenseMember.Player.FielderAbility.Defense += int.Parse(m_DefenseValue2.Text);
                defenseMember.Player.FielderAbility.Wisdom += int.Parse(m_WisdomValue2.Text);
                if (defenseMember.DefensePosition == DefensePosition.Pitcher)
                {
                    defenseMember.Player.PitcherAbility.Fastball += int.Parse(m_FastBoll.Text);
                    defenseMember.Player.PitcherAbility.Breakingball += int.Parse(m_BreakingBoll.Text);
                    defenseMember.Player.PitcherAbility.Control += int.Parse(m_Control.Text);
                    defenseMember.Player.PitcherAbility.SpecialPitcherAbility = SpecialAbilityHelper.GetSpecialPitcherAbility(m_SpecialPitcherAbility.Text);
                }
            }

            // マネージャの生成
            GameManager gameManager = new GameManager(topTeamSetting, bottomTeamSetting, true);

            // ランナー作成
            if (m_FirstRunner.Checked)
            {
                gameManager.GameData.SetRunnerMember(BaseKind.FirstBase, topTeamSetting.CurrentPlayingMembers[0]);
            }
            if (m_SecondRunner.Checked)
            {
                gameManager.GameData.SetRunnerMember(BaseKind.SecondBase, topTeamSetting.CurrentPlayingMembers[0]);
            }
            if (m_ThirdRunner.Checked)
            {
                gameManager.GameData.SetRunnerMember(BaseKind.ThirdBase, topTeamSetting.CurrentPlayingMembers[0]);
            }

            // アウトカウントの設定
            // (ランナーが進塁しやすいように2アウトとするか、併殺率を測るために0アウトとする)
            if (m_TwoOut.Checked)
            {
                gameManager.GameData.OutCount = 2;
            }
            else
            {
                gameManager.GameData.OutCount = 0;
            }

            // 前進守備かどうかの設定
            gameManager.GameData.InFielderDrawIn = m_DrawInDefense.Checked;
            gameManager.GameData.OutFielderDrawIn = m_DrawInDefense.Checked;
            // バントシフトの設定
            if (m_BuntShift.Checked)
            {
                gameManager.GameData.InFielderDrawIn = true;
                gameManager.GameData.BuntShift = true;
            }

            // 守備が左投げかの設定
            if (m_DefenseLeftThrow.Checked)
            {
                foreach (GameMember member in gameManager.GameData.CurrentDefenseTeam.CurrentPlayingMembers)
                {
                    member.Player.IsLeftThrow = true;
                }
            }

            return gameManager;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 対戦チームリストの初期化
        /// </summary>
        private void InitializeTeamSetting()
        {
            // 対戦チームのドロップダウンリストの選択肢作成
            m_TeamSettings.Clear();
            m_TopTeamList.Items.Clear();
            m_BottomTeamList.Items.Clear();
            TeamSettingBuilder builder = new TeamSettingBuilder();
            foreach (TeamNumber teamNumber in Enum.GetValues(typeof(TeamNumber)))
            {
                // チーム名を特定するためにチームを生成する
                TeamSetting teamSetting = builder.CreateTeamSetting(teamNumber);

                // リストに登録
                m_TeamSettings.Add(teamSetting);
                m_TopTeamList.Items.Add(teamSetting.Name);
                m_BottomTeamList.Items.Add(teamSetting.Name);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 初期データ作成
        /// (2回以上実行されても問題ない)
        /// </summary>
        /// <param name="topTeamNumber">先行チーム</param>
        /// <param name="bottomTeamNumber">後攻チーム</param>
        private void InitializeData(TeamNumber topTeamNumber, TeamNumber bottomTeamNumber)
        {
            // すでにイベントが接続済みであれば削除する
            if (m_GameManager != null)
            {
                m_GameManager.AfterPitchAndBat -= (GameManager_AfterPitchAndBat);
                m_GameManager.AfterEndBatter -= (GameManager_AfterEndBatter);
                m_GameManager.PassedDefenseTerm -= (GameManager_PassedDefenseTerm);
                m_GameManager.JudgedSafeOrOut -= (GameManager_JudgedSafeOrOut);
            }

            // 対戦チーム同士が自動的に代打・投手交代を行うようにデバッグモードをONにする
            EVManager.Instance.DebugMode = true;

            // マネージャの生成
            TeamSettingBuilder builder = new TeamSettingBuilder();
            m_GameManager = new GameManager(builder.CreateTeamSetting(topTeamNumber), builder.CreateTeamSetting(bottomTeamNumber), true);

            // 守備位置の設定
            GameData gameData = m_GameManager.GameData;
            pictureBox1.Location = CustomPoint.GetPoint(gameData.Defense1Point);
            pictureBox2.Location = CustomPoint.GetPoint(gameData.Defense2Point);
            pictureBox3.Location = CustomPoint.GetPoint(gameData.Defense3Point);
            pictureBox4.Location = CustomPoint.GetPoint(gameData.Defense4Point);
            pictureBox5.Location = CustomPoint.GetPoint(gameData.Defense5Point);
            pictureBox6.Location = CustomPoint.GetPoint(gameData.Defense6Point);
            pictureBox9.Location = CustomPoint.GetPoint(gameData.Defense9Point);
            pictureBox8.Location = CustomPoint.GetPoint(gameData.Defense8Point);
            pictureBox7.Location = CustomPoint.GetPoint(gameData.Defense7Point);

            // ベース位置の設定
            pictureBox15.Location = CustomPoint.GetPoint(Constants.PointFirstBase);
            pictureBox16.Location = CustomPoint.GetPoint(Constants.PointSecondBase);
            pictureBox17.Location = CustomPoint.GetPoint(Constants.PointThirdBase);
            pictureBox18.Location = CustomPoint.GetPoint(Constants.PointHomeBase);

            // フェンスオーバーの目印の設定
            pictureBox19.Location = CustomPoint.GetPoint(Constants.RightFenseOverPoint);
            pictureBox20.Location = CustomPoint.GetPoint(Constants.CenterFenseOverPoint);
            pictureBox21.Location = CustomPoint.GetPoint(Constants.LeftFenseOverPoint);

            // 表示更新
            UpdateGameDataDisplay();

            // イベント接続
            m_GameManager.AfterPitchAndBat += (GameManager_AfterPitchAndBat);
            m_GameManager.AfterEndBatter += (GameManager_AfterEndBatter);
            m_GameManager.PassedDefenseTerm += (GameManager_PassedDefenseTerm);
            m_GameManager.JudgedSafeOrOut += (GameManager_JudgedSafeOrOut);
        }