Beispiel #1
0
        /************************************************************************/
        /* アクセサ                                                             */
        /************************************************************************/

        /// <summary>
        /// 参加メンバー情報の設定
        /// </summary>
        /// <param name="iJoinMemberInfo">参加メンバー情報</param>
        public void SetJoinMemberInfo(BattleManager.SBattleJoinInfo iJoinMemberInfo)
        {
            //テキスト系設定
            MemberNoTextBlock.Text   = string.Format("参加No.{0:D2}", iJoinMemberInfo.mJoinID + 1);
            MemberNameTextBlock.Text = MemberManager.GetInstance().GetMemberInfo(iJoinMemberInfo.mMemberID).mName;

            //アイコン設定
            bool set_Valid_Use_Character_ID_Flg = (iJoinMemberInfo.mUserCharacterID != -1);

            if (set_Valid_Use_Character_ID_Flg)
            {
                try
                {
                    UseCharacterImage.Source = PresetManager.GetInstance().GetCharacterInfo(iJoinMemberInfo.mUserCharacterID).mIconImage;
                }
                catch (System.Exception)
                {
                    set_Valid_Use_Character_ID_Flg = false;
                }
            }
            if (!set_Valid_Use_Character_ID_Flg)
            {
                UseCharacterImage.Source = PresetManager.GetInstance().GetUnknownCharacterIcon();
            }
        }
        /************************************************************************/
        /* 内部処理                                                             */
        /************************************************************************/

        //============================================================================
        //! 各種大会テーブルの作成
        private void _CreateBattleTable(int iMemberID)
        {
            var battle_manager = BattleManager.GetInstance();
            var preset_manager = PresetManager.GetInstance();
            var result_list    = battle_manager.GetMemberBattleResultList(iMemberID, false);
            var total_list     = new List <TotalBattleData>();

            foreach (var iIndex in System.Linq.Enumerable.Range(0, result_list.Count))
            {
                //大会情報取得
                var result = result_list[result_list.Count - iIndex - 1];
                var info   = battle_manager.GetBattle(result.mIndex);

                //全ての部分の追加
                var total_data = new TotalBattleData();
                total_data.Icon           = preset_manager.GetCharacterInfo(result.mUseCharacterID).mIconImage;
                total_data.UseCharacterID = result.mUseCharacterID;
                total_data.BattleID       = result.mIndex;
                total_data.Name           = info.mName;
                var split_list = info.mDate.Split(' ');
                total_data.BattleDate = split_list[0] + "\n" + split_list[1];
                total_data.BattleKind = info.mBattleKind;
                total_list.Add(total_data);

                //種別別に登録
                if (info.mBattleKind == BattleManager.EBattleKind.BATTLE_SIMPLE_TOURNAMENT)
                {
                    var control = new SimpleTournamentResultControl(iMemberID, result, info);
                    SimpleTournamentStackPanel.Children.Add(control);
                }
            }
            BattleGridView.ItemsSource = total_list;
        }
Beispiel #3
0
        /************************************************************************/
        /* 内部処理                                                             */
        /************************************************************************/

        //============================================================================
        //! プロジェクトファイルのロード
        private bool _LoadProjectFile(string iFilePath)
        {
            try
            {
                //ファイルが無ければ無視
                if (!System.IO.File.Exists(iFilePath))
                {
                    return(false);
                }

                //必要なマネージャの初期化
                SaveManager.GetInstance().ProjectFilePath = iFilePath;
                DataManager.GetInstance().ReadData(iFilePath);
                MemberManager.GetInstance().LoadMemberData();
                BattleManager.GetInstance().LoadBattleData();
                PresetManager.GetInstance().LoadPreset();
                SystemManager.GetInstance().LoadSystemData();

                return(true);
            }
            catch (System.Exception)
            {
                return(false);
            }
        }
Beispiel #4
0
        /************************************************************************/
        /* アクセサ                                                             */
        /************************************************************************/

        /// <summary>
        /// メンバー情報の設定
        /// </summary>
        /// <param name="iMemberInfo">メンバー情報</param>
        public void SetMemberInfo(MemberManager.SMemberInfo iMemberInfo)
        {
            //保持
            mUseMemberInfo = iMemberInfo;

            //テキスト系設定
            MemberNoTextBlock.Text   = string.Format("No.{0:D3}", iMemberInfo.mID + 1);
            MemberNameTextBlock.Text = iMemberInfo.mName;

            //アイコン設定
            bool set_Valid_Use_Character_ID_Flg = (iMemberInfo.mDefaultCharacterID != -1);

            if (set_Valid_Use_Character_ID_Flg)
            {
                try
                {
                    UseCharacterImage.Source = PresetManager.GetInstance().GetCharacterInfo(iMemberInfo.mDefaultCharacterID).mIconImage;
                }
                catch (System.Exception)
                {
                    set_Valid_Use_Character_ID_Flg = false;
                }
            }
            if (!set_Valid_Use_Character_ID_Flg)
            {
                UseCharacterImage.Source = PresetManager.GetInstance().GetUnknownCharacterIcon();
            }
        }
 /// <summary>
 /// コンストラクタ
 /// </summary>
 public TournamentControl()
 {
     InitializeComponent();
     BackgroundImage.Source = PresetManager.GetInstance().GetBackGroundImage();
     SystemManager.GetInstance().SetCloseCheckCallback(_CheckClose);
     SystemManager.GetInstance().SetInputKeyDelegate(_InputKey);
     TeamDetailsControl.Visibility = Visibility.Hidden;
     MainControl.SetTeamDisplay(TeamDetailsControl);
 }
        /************************************************************************/
        /* 公開処理																*/
        /************************************************************************/

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MemberAddWindow()
        {
            InitializeComponent();
            MemberNameTextBox.Text = "";
            MemberNameTextBox.Focus();

            //コンボボックス設定
            CharacterComboBox.Items.Add("未選択");
            foreach (var iInfo in PresetManager.GetInstance().GetCharacterList())
            {
                CharacterComboBox.Items.Add(iInfo.mName);
            }
            CharacterComboBox.SelectedIndex = 0;
        }
        /************************************************************************/
        /* アクセサ                                                             */
        /************************************************************************/

        /// <summary>
        /// 表示情報設定
        /// </summary>
        /// <param name="iInfoIndex">表示情報番号</param>
        public void SetInfo(int iInfoIndex)
        {
            string top_Name        = "";
            int    character_Index = -1;

            //チーム戦の場合
            if (BattleOperatorManager.GetInstance().IsTeamBattleFlg())
            {
                var team_Info = BattleOperatorManager.GetInstance().GetTeamInfo(iInfoIndex);
                top_Name = team_Info.mTeamName;

                var join_Info = new BattleManager.SBattleJoinInfo();
                BattleOperatorManager.GetInstance().GetJoinInfo(ref join_Info, team_Info.mJoinIDList[0]);
                character_Index = join_Info.mUserCharacterID;
            }
            //シングル戦の場合
            else
            {
                var join_Info = new BattleManager.SBattleJoinInfo();
                BattleOperatorManager.GetInstance().GetJoinInfo(ref join_Info, iInfoIndex);
                top_Name        = MemberManager.GetInstance().GetMemberInfo(join_Info.mMemberID).mName;
                character_Index = join_Info.mUserCharacterID;
            }

            //設定
            TopTextBlock.Text = top_Name;
            bool set_Valid_Use_Character_ID_Flg = (character_Index != -1);

            if (set_Valid_Use_Character_ID_Flg)
            {
                try
                {
                    TopCharacterImage.Source = PresetManager.GetInstance().GetCharacterInfo(character_Index).mIconImage;
                }
                catch (System.Exception)
                {
                    set_Valid_Use_Character_ID_Flg = false;
                }
            }
            if (!set_Valid_Use_Character_ID_Flg)
            {
                TopCharacterImage.Source = PresetManager.GetInstance().GetUnknownCharacterIcon();
            }
            TopCharacterImage.Visibility = Visibility.Visible;
            mInfoIndex = iInfoIndex;
        }
Beispiel #8
0
        //============================================================================
        //! 新しいプロジェクトの作成ボタンが押された
        private void _ClickNewProject(object iSender, RoutedEventArgs iArgs)
        {
            //プリセットデータを選択させて一旦保存してから開始
            var window = new SelectPresetWindow();

            window.ShowDialog();
            string preset_name = window.GetPresetName();

            if (preset_name == null)
            {
                return;
            }

            //プロジェクトの保管先の設定
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.Filter           = "FCあどみぃ!プロジェクトファイル(*.pjb)|*.pjb|すべてのファイル(*.*)|*.*";
            dialog.Title            = "プロジェクトファイルを選択してください";
            dialog.RestoreDirectory = true;
            dialog.InitialDirectory = SystemUtility.GetSystemPath();
            if (dialog.ShowDialog() == true)
            {
                //データの設定
                DataManager.GetInstance().SetData(SaveManager.GetInstance().PresetInfoKey, preset_name);

                //一旦状態保存
                var info = new SSerialData();
                info.mLastRefFilePath = dialog.FileName;
                DataManager.GetInstance().SetData(SystemUtility.GetSceneName(this), info);
                SaveManager.GetInstance().ProjectFilePath = dialog.FileName;
                SaveManager.GetInstance().SaveProject();
                SaveManager.GetInstance().SaveContentData();

                //必要なマネージャの初期化
                MemberManager.GetInstance().LoadMemberData();
                BattleManager.GetInstance().LoadBattleData();
                PresetManager.GetInstance().LoadPreset();
                SystemManager.GetInstance().LoadSystemData();

                _StartUpTool();
            }
        }
Beispiel #9
0
        /// <summary>
        /// キャラクター番号の設定
        /// </summary>
        /// <param name="iCharacterID">キャラクター</param>
        public void SetCharacter(int iCharacterID)
        {
            bool set_Valid_Use_Character_ID_Flg = (iCharacterID != -1);

            if (set_Valid_Use_Character_ID_Flg)
            {
                try
                {
                    UseCharacterImage.Source = PresetManager.GetInstance().GetCharacterInfo(iCharacterID).mIconImage;
                }
                catch (System.Exception)
                {
                    set_Valid_Use_Character_ID_Flg = false;
                }
            }
            if (!set_Valid_Use_Character_ID_Flg)
            {
                UseCharacterImage.Source = PresetManager.GetInstance().GetUnknownCharacterIcon();
            }
        }
        /************************************************************************/
        /* 内部処理                                                             */
        /************************************************************************/

        //============================================================================
        //! キャラクターリストの作成
        public void _CreateCharacterList()
        {
            var set_Width   = SelectCharacterScrollViewer.Width;
            int color_Index = 0;
            var color_List  = new Brush[2] {
                new SolidColorBrush(SystemUtility.StringToColor("#55000000")), new SolidColorBrush(SystemUtility.StringToColor("#55555555"))
            };

            //作成
            foreach (var iCharacter in PresetManager.GetInstance().GetCharacterList())
            {
                var control = new CharacterSelectListControl();
                control.Width      = set_Width;
                control.Background = color_List[color_Index % 2];
                control.SetCharacterInfo(iCharacter);
                control.TabIndex = iCharacter.mIndex;
                control.PreviewMouseLeftButtonDown += _ClickCharacter;
                SelectCharacterStackPanel.Children.Add(control);
                ++color_Index;
            }
        }
Beispiel #11
0
        /************************************************************************/
        /* 基本処理                                                             */
        /************************************************************************/

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public SimpleTournamentResultControl(int iMemberID, BattleManager.SMemberBattleResult iResult, BattleManager.SBattleInfo iBattleInfo)
        {
            InitializeComponent();

            //情報登録
            bool team_flg = (iBattleInfo.mTeamList.Count != 0);

            MainGroupBox.Header          = "大会No." + iResult.mIndex.ToString() + " - " + iBattleInfo.mName + " -";
            TournamentKindTextBlock.Text = "種別:" + (team_flg ? "チーム戦" : "シングル戦");
            JoinNumTextBlock.Text        = "参加人数:" + iBattleInfo.mJoinList.Count.ToString() + "人";
            DateTextBlock.Text           = "開催日時 " + iBattleInfo.mDate;
            JoinTeamNumTextBlock.Text    = team_flg ? "参加チーム数:" + iBattleInfo.mTeamList.Count.ToString() + "チーム" : "";
            ResultTextBlock.Text         = "- ";
            var obj    = (SimpleTournamentObject)iBattleInfo.mBattleObject;
            var result = obj.GetSimpleTournamentResult(iBattleInfo, iMemberID);

            if (result.mRank == 1)
            {
                ResultTextBlock.Text += "優勝";
            }
            else if (result.mRank == 2)
            {
                ResultTextBlock.Text      += "準優勝";
                ResultTextBlock.Foreground = SystemUtility.CreateLinearGradientBrash(SystemUtility.StringToColor("#FFFFFF00"), SystemUtility.StringToColor("#FFFFFFF55"));
            }
            else
            {
                ResultTextBlock.Text      += ("第" + result.mRank + "位");
                ResultTextBlock.Foreground = new SolidColorBrush(SystemUtility.StringToColor("#FF5555FF"));
            }
            ResultTextBlock.Text        += " -";
            BeginVersusNumTextBlock.Text = result.mBeginVersus.ToString() + "回戦からの開始";
            var character_Info = PresetManager.GetInstance().GetCharacterInfo(iResult.mUseCharacterID);

            CharacterIcon.Source       = character_Info.mIconImage;
            UseCharacterTextBlock.Text = "使用キャラ:" + character_Info.mName;
        }
        /************************************************************************/
        /* 基本処理                                                             */
        /************************************************************************/

        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="iMemberID">メンバーID</param>
        public MenberDetailWindow(int iMemberID)
        {
            InitializeComponent();

            //メンバー情報登録
            var member_manager = MemberManager.GetInstance();
            var member_info    = member_manager.GetMemberInfo(iMemberID);

            Title = member_info.mName + "の詳細";
            RegistTextBlock.Text           = string.Format("登録番号No.{0:D3}", iMemberID);
            RegistDateTextBlock.Text       = "登録日時 " + member_info.mResistDate;
            MemberNameTextBlock.Text       = member_info.mName;
            MemberNameShadowTextBlock.Text = member_info.mName;

            //アイコン設定
            bool set_Valid_Use_Character_ID_Flg = (member_info.mDefaultCharacterID != -1);

            if (set_Valid_Use_Character_ID_Flg)
            {
                try
                {
                    CharacterIcon.Source = PresetManager.GetInstance().GetCharacterInfo(member_info.mDefaultCharacterID).mIconImage;
                }
                catch (System.Exception)
                {
                    set_Valid_Use_Character_ID_Flg = false;
                }
            }
            if (!set_Valid_Use_Character_ID_Flg)
            {
                CharacterIcon.Source = PresetManager.GetInstance().GetUnknownCharacterIcon();
            }

            //大会情報登録
            _CreateBattleTable(iMemberID);
        }
        /************************************************************************/
        /* 基本処理	                                                            */
        /************************************************************************/

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MemberSearchWindow()
        {
            InitializeComponent();

            //初期設定
            MemberNameTextBox.Text         = "";
            MemberNameTextBox.TextChanged += (iSender, iArgs) =>
            {
                _ChangeSearch();
            };

            //コンボボックス初期化
            CharacterIDComboBox.Items.Add("未選択");
            foreach (var iCharacterInfo in PresetManager.GetInstance().GetCharacterList())
            {
                mCharacterIDList.Add(iCharacterInfo.mIndex);
                CharacterIDComboBox.Items.Add(iCharacterInfo.mName);
            }
            CharacterIDComboBox.SelectedIndex     = 0;
            CharacterIDComboBox.SelectionChanged += (iSender, iArgs) =>
            {
                _ChangeSearch();
            };
        }
        /************************************************************************/
        /* 内部定義                                                             */
        /************************************************************************/

        //============================================================================
        //! テーブルの初期化
        private void _InitializeTable()
        {
            //メンバー全員を入れる
            var member_manager = MemberManager.GetInstance();
            var battle_manager = BattleManager.GetInstance();

            foreach (var iMember in member_manager.GetMemberList())
            {
                //基本情報
                var data = new MemberDetailsData();
                data.ID             = iMember.mID;
                data.IDString       = string.Format("{0:D3}", iMember.mID);
                data.Name           = iMember.mName;
                data.DefaultCharaID = iMember.mDefaultCharacterID;
                var split = iMember.mResistDate.Split(' ');
                data.RegistaDate = (split.Length == 2) ? split[0] + "\n" + split[1] : iMember.mResistDate;

                //大会情報
                var result_list = battle_manager.GetMemberBattleResultList(iMember.mID, true);
                data.JoinTournamentVal = result_list.Count;
                if (data.JoinTournamentVal == 0)
                {
                    data.LastJoinTournamentDate = "---";
                }
                else
                {
                    int battle_index = result_list[0].mIndex;
                    data.LastJoinTournamentDate += battle_manager.GetBattle(result_list[0].mIndex).mDate;
                    for (var index = 1; index < result_list.Count; ++index)
                    {
                        var date = battle_manager.GetBattle(result_list[index].mIndex).mDate;
                        if (data.LastJoinTournamentDate.CompareTo(date) < 0)
                        {
                            data.LastJoinTournamentDate = date;
                            battle_index = result_list[index].mIndex;
                        }
                    }
                    data.LastJoinTournamentDate = battle_manager.GetBattle(battle_index).mName + "\n" + data.LastJoinTournamentDate;
                }

                //アイコン設定
                bool set_Valid_Use_Character_ID_Flg = (iMember.mDefaultCharacterID != -1);
                if (set_Valid_Use_Character_ID_Flg)
                {
                    try
                    {
                        data.Icon = PresetManager.GetInstance().GetCharacterInfo(iMember.mDefaultCharacterID).mIconImage;
                    }
                    catch (System.Exception)
                    {
                        set_Valid_Use_Character_ID_Flg = false;
                    }
                }
                if (!set_Valid_Use_Character_ID_Flg)
                {
                    data.Icon = PresetManager.GetInstance().GetUnknownCharacterIcon();
                }

                mMemberGridTable.Add(data);
            }

            //バインド
            MemberDataGrid.ItemsSource = mMemberGridTable;
        }
Beispiel #15
0
        /************************************************************************/
        /* コールバック処理                                                     */
        /************************************************************************/

        //============================================================================
        //! ロード時の処理
        private void _Loaded(object iSender, RoutedEventArgs iArgs)
        {
            //シーンの初期化
            var scene_Manager = SceneManager.GetInstance();

            scene_Manager.SetControls(ContentControl, LeftFilterImage, RightFilterImage);
            LeftFilterImage.Margin = RightFilterImage.Margin = new Thickness();

            //ロードコンテンツを設定する
#if DL_DEBUG
            //ライセンス作成
            if (true)
            {
                SystemUtility.CreateLicenseFiles(1);
                return;
            }
            bool test = true;
            if (test)
            {
                //データの設定
                DataManager.GetInstance().SetData(SaveManager.GetInstance().PresetInfoKey, "BLAZBLUE CHRONOPHANTASMA");

                //プロジェクトデータ設定
                SaveManager.GetInstance().ProjectFilePath = @"C:\FCあどみぃ!\FCあどみぃ!\System\デバッグプロジェクト.pjb";
                DataManager.GetInstance().ReadData(SaveManager.GetInstance().ProjectFilePath);

                //必要なマネージャの初期化
                MemberManager.GetInstance().LoadMemberData();
                BattleManager.GetInstance().LoadBattleData();
                PresetManager.GetInstance().LoadPreset();
                SystemManager.GetInstance().LoadSystemData();

                //大会設定
                var btl_Op_Manager = BattleOperatorManager.GetInstance();
                btl_Op_Manager.BeginBattle(BattleManager.EBattleKind.BATTLE_SIMPLE_TOURNAMENT);
                btl_Op_Manager.SetBattleName("デバッグ大会!");
                btl_Op_Manager.SetBattleObject(new SimpleTournamentObject());

                //メンバー設定
                //scene_Manager.AdvanceScene(SceneManager.EScene.SCENE_MEMBER_SELECT);
                foreach (var iIndex in System.Linq.Enumerable.Range(0, 32))
                {
                    btl_Op_Manager.AddMember(iIndex);
                }
                btl_Op_Manager.SetLockJoinMember(true);

                //チーム設定
                var team_Val = 16;
                if (BattleOperatorManager.GetInstance().GetJoinMemberVal() % team_Val != 0)
                {
                    throw new System.Exception();
                }
                var in_Member_Val = BattleOperatorManager.GetInstance().GetJoinMemberVal() / team_Val;
                foreach (var iIndex in System.Linq.Enumerable.Range(0, team_Val))
                {
                    var info = new BattleManager.SBattleTeamInfo();
                    info.mTeamID     = iIndex;
                    info.mTeamName   = string.Format("Team{0}", iIndex);
                    info.mJoinIDList = new List <int>();
                    foreach (var iMemberIndex in System.Linq.Enumerable.Range(0, in_Member_Val))
                    {
                        info.mJoinIDList.Add((iIndex * in_Member_Val) + iMemberIndex);
                    }
                    btl_Op_Manager.AddTeam(info);
                }
                btl_Op_Manager.SetLockTeam(true);



                //scene_Manager.AdvanceScene(SceneManager.EScene.SCENE_TEAM_SELECT);
                scene_Manager.AdvanceScene(SceneManager.EScene.SCENE_BATTLE_SIMPLE_TOURNAMENT);

                /*紅白戦
                 * var team = (TeamSelectScene)scene_Manager.AdvanceScene(SceneManager.EScene.SCENE_TEAM_SELECT);
                 * team.AddTeam("紅組");
                 * team.AddTeam("白組");
                 * team.SetTeamOperateFlg(false);*/

                //scene_Manager.AdvanceScene(SceneManager.EScene.SCENE_MEMBER_SELECT);
            }
            else
#endif
            {
                var load_Scene = new LoadScene();
                LoadContent.Content = load_Scene;
            }
        }
Beispiel #16
0
        /// <summary>
        /// 選択しているキャラクター番号の取得
        /// </summary>
        /// <returns></returns>
        public int GetSelectCharacterIndex()
        {
            var chara_Name = CharacterComboBox.SelectedItem.ToString();

            return(PresetManager.GetInstance().GetCharacterIndex(chara_Name));
        }
Beispiel #17
0
        //============================================================================
        //! メンバーの編集ボタンが押された時の処理
        private void _ClickEditMember(object iSender, RoutedEventArgs iArgs)
        {
            //チェック
            var button = iSender as Button;

            if (button == null)
            {
                return;
            }

            //押されたボタンのメンバー情報取得
            int id          = button.TabIndex;
            var member_Info = MemberManager.GetInstance().GetMemberInfo(id);

            //選択されているセルが無かった場合は無視
            var window = new MemberAddWindow();

            window.Title = "メンバー編集";
            int index = 1;

            foreach (var iInfo in PresetManager.GetInstance().GetCharacterList())
            {
                if (iInfo.mIndex == member_Info.mDefaultCharacterID)
                {
                    window.CharacterComboBox.SelectedIndex = index;
                    break;
                }
                ++index;
            }

            string current_Name = member_Info.mName;

            window.MemberNameTextBox.Text = current_Name;
            window.AddButton.Content      = "決定";

            //追加ボタンが押されたときの重複チェック
            window.AddButton.Click += (iClickSender, iClickArgs) =>
            {
                //既に名前がある場合は無効
                string name = window.MemberNameTextBox.Text;
                foreach (var iInfo in MemberManager.GetInstance().GetMemberList())
                {
                    if (iInfo.mName == name)
                    {
                        //現在の自分の物の場合は無視
                        if (current_Name != name)
                        {
                            iClickArgs.Handled = true;
                            string txt = string.Format("既に「{0}」という名前は存在します\n別の名前にして下さい", name);
                            SystemUtility.DisplayErrorDialog(txt);
                            break;
                        }
                    }
                }
            };
            window.SettingCallback();
            //追加が押されて全ての条件を満たした時に追加
            window.AddButton.Click += (iClickSender, iClickArgs) =>
            {
                if (current_Name != window.MemberNameTextBox.Text ||
                    member_Info.mDefaultCharacterID != window.GetSelectCharacterIndex())
                {
                    try
                    {
                        member_Info.mName = window.MemberNameTextBox.Text;
                        member_Info.mDefaultCharacterID = window.GetSelectCharacterIndex();
                        MemberManager.GetInstance().SetMemberInfo(id, member_Info);
                        _RefreshMemberList();
                    }
                    catch (System.Exception)
                    {
                    }
                }
            };

            window.ShowDialog();
        }