Exemplo n.º 1
0
        //シナリオラベル区切りのデータを作成
        void MakeScanerioLabelData(List <AdvCommand> commandList)
        {
            if (commandList.Count <= 0)
            {
                return;
            }

            //最初のラベル区切りデータは自身の名前(シート名)
            AdvScenarioLabelData data = new AdvScenarioLabelData(Name, null);
            int commandIndex          = 0;

            while (true)
            {
                //重複してないかチェック
                if (IsContainsScenarioLabel(data.ScenaioLabel))
                {
                    Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, data.ScenaioLabel, DataGridName));
                    break;
                }
                scenarioLabelData.Add(data);

                //コマンドを追加
                while (commandIndex < commandList.Count)
                {
                    AdvCommand command = commandList[commandIndex];
                    //シナリオラベルがあるので、終了
                    if (!string.IsNullOrEmpty(command.GetScenarioLabel()))
                    {
                        break;
                    }
                    data.AddCommand(command);
                    ///このシナリオからリンクするジャンプ先のシナリオラベルを取得
                    string[] jumpLabels = command.GetJumpLabels();
                    if (jumpLabels != null)
                    {
                        foreach (var jumpLabel in jumpLabels)
                        {
                            jumpScenarioData.Add(new AdvScenarioJumpData(jumpLabel, command.RowData));
                        }
                    }
                    ++commandIndex;
                }
                //ページデータの初期化処理
                data.InitPages();
                if (commandIndex >= commandList.Count)
                {
                    break;
                }
                data = new AdvScenarioLabelData(commandList[commandIndex].GetScenarioLabel(), commandList[commandIndex] as AdvCommandScenarioLabel);
                ++commandIndex;
            }
        }