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

            //最初のラベル区切りデータは自身の名前(シート名)
            string scenarioLabel = Name;
            AdvCommandScenarioLabel scenarioLabelCommand = null;
            AdvScenarioLabelData    scenarioLabelData    = null;
            int commandIndex = 0;

            do
            {
                int begin = commandIndex;
                //コマンドを追加
                while (commandIndex < commandList.Count)
                {
                    //シナリオラベルがあるので、終了
                    if (commandList[commandIndex] is AdvCommandScenarioLabel)
                    {
                        break;
                    }
                    ++commandIndex;
                }

                if (IsContainsScenarioLabel(scenarioLabel))
                {
                    //重複してないかチェック
                    Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, scenarioLabel, DataGridName));
                }
                else
                {
                    //ラベルデータ追加
                    AdvScenarioLabelData next = new AdvScenarioLabelData(scenarioLabel, scenarioLabelCommand, commandList.GetRange(begin, commandIndex - begin));
                    if (scenarioLabelData != null)
                    {
                        scenarioLabelData.Next = next;
                    }
                    scenarioLabelData = next;
                    scenarioLabels.Add(scenarioLabel, next);
                }

                if (commandIndex >= commandList.Count)
                {
                    break;
                }

                scenarioLabelCommand = commandList[commandIndex] as AdvCommandScenarioLabel;
                scenarioLabel        = scenarioLabelCommand.ScenarioLabel;
                ++commandIndex;
            } while (true);
        }
        private void MakeScanerioLabelData(List <AdvCommand> commandList)
        {
            if (commandList.Count <= 0)
            {
                return;
            }
            string name = this.Name;
            AdvCommandScenarioLabel scenarioLabelCommand = null;
            AdvScenarioLabelData    data = null;
            int num = 0;

            while (true)
            {
                int index = num;
                while (num < commandList.Count)
                {
                    if (commandList[num] is AdvCommandScenarioLabel)
                    {
                        break;
                    }
                    num++;
                }
                if (this.IsContainsScenarioLabel(name))
                {
                    object[] args = new object[] { name, this.DataGridName };
                    Debug.LogError(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.RedefinitionScenarioLabel, args));
                }
                else
                {
                    AdvScenarioLabelData data2 = new AdvScenarioLabelData(name, scenarioLabelCommand, commandList.GetRange(index, num - index));
                    if (data != null)
                    {
                        data.Next = data2;
                    }
                    data = data2;
                    this.scenarioLabels.Add(name, data2);
                }
                if (num >= commandList.Count)
                {
                    return;
                }
                scenarioLabelCommand = commandList[num] as AdvCommandScenarioLabel;
                name = scenarioLabelCommand.ScenarioLabel;
                num++;
            }
        }
示例#3
0
        //コンストラクタ
        internal AdvScenarioLabelData(string scenarioLabel, AdvCommandScenarioLabel scenarioLabelCommand, List <AdvCommand> commandList)
        {
            this.ScenarioLabel        = scenarioLabel;
            this.scenarioLabelCommand = scenarioLabelCommand;
            this.CommandList          = commandList;
            this.PageDataList         = new List <AdvScenarioPageData>();
            if (CommandList.Count <= 0)
            {
                return;
            }

            int commandIndex = 0;

            do
            {
                int begin = commandIndex;
                int end   = GetPageEndCommandIndex(begin);
                //ページデータ追加
                PageDataList.Add(new AdvScenarioPageData(this, PageDataList.Count, CommandList.GetRange(begin, end - begin + 1)));
                commandIndex = end + 1;
            } while (commandIndex < CommandList.Count);

            this.PageDataList.ForEach(x => x.Init());
        }
示例#4
0
 //コンストラクタ
 internal AdvScenarioLabelData(string scenaioLabel, AdvCommandScenarioLabel scenarioLabelCommand)
 {
     this.scenaioLabel         = scenaioLabel;
     this.scenarioLabelCommand = scenarioLabelCommand;
 }