Beispiel #1
0
        public void Add(Scenario scenario)
        {
            if (null == scenario)
            {
                return;
            }

            ScenarioList.Add(scenario);

            scenario.Owner   = this;
            SelectedScenario = scenario;
        }
 private void updateLearningScenariosInfo()
 {
     foreach (LearningScenario learningScenario in listLearningScenarion)
     {
         ScenarioList.Add(new LearningScenarioViewModel
         {
             Name                 = learningScenario.Name,
             SelectionType        = learningScenario.SelectionParameters.Split(',')[0],
             MixSeed              = learningScenario.SelectionParameters.Split(',')[1],
             SeparationParamValue = learningScenario.SelectionParameters.Split(',')[2],
             TeacherType          = learningScenario.LearningAlgorithmName,
             AlgoParam            = learningScenario.LAParameters,
             ID = learningScenario.ID
         });
     }
     NotifyPropertyChanged();
 }
Beispiel #3
0
        void InitData(StringGrid grid)
        {
            grid.InitLink();
            string sheetName = grid.SheetName;

            if (AdvSettingDataManager.IsDisabelSheetName(sheetName))
            {
                Debug.LogError(sheetName + " is invalid name");
                return;
            }
            if (AdvSettingDataManager.IsSettingsSheet(grid.SheetName))
            {
                SettingList.Add(grid);
            }
            else
            {
                ScenarioList.Add(grid);
            }
        }
        private void QuestDetail(Session oS)
        {
            this.ScenarioStart();

            var path = oS.PathAndQuery.Split('?');

            PathName = path[0];
            PathName = PathName.Substring(1, path[0].Count() - 1);
            PathName = PathName.Replace("/", "_");

            this.ScenarioName = PathName;

            if (this.ScenarioList == null)
            {
                this.ScenarioList = new List <Scenario>();
            }
            else
            {
                this.ScenarioList.Clear();
                this.ScenarioList.TrimExcess();
            }

            JArray  jsonVal = JArray.Parse(oS.GetResponseBodyAsString()) as JArray;
            dynamic Details = jsonVal;

            this.ProgressStatus         = new LimitedValue();
            this.ProgressStatus.Max     = Details.Count;
            this.ProgressStatus.Min     = 0;
            this.ProgressStatus.Current = 0;

            this.ProgressBar();
            string TranslateDir = "Google";

            if (TranslateSite == TranslateKind.Naver)
            {
                TranslateDir = "Naver";
            }

            if (File.Exists(Path.Combine(MainFolder, "Translations", "Scenarios", TranslateDir, PathName + ".xml")))
            {
                foreach (var detail in Details)
                {
                    string dtl = detail.detail;
                    //string sel1 = detail.sel1_txt;
                    //string sel2 = detail.sel2_txt;

                    Scenario temp = new Scenario
                    {
                        context = RemoveWebTag(dtl),
                        index   = detail.id,
                    };
                    if (detail.charcter1_name != "null")
                    {
                        temp.Name = detail.charcter1_name;
                    }
                    else
                    {
                        temp.Name = "";
                    }

                    temp.TrName = GrandcypherClient.Current.Translations.ReplaceTranslation(temp.Name);


                    temp.TrContext = GrandcypherClient.Current.Translations.GetTranslation(TranslationType.ScenarioDetail, temp.context, TranslateSite);
                    //if (sel1 != null)
                    //{
                    //	temp.sel1_txt = RemoveWebTag(sel1);
                    //	temp.Trsel1 = Translator(temp.sel1_txt, TranslateSite);
                    //}
                    //if (sel2 != null)
                    //{
                    //	temp.sel2_txt = RemoveWebTag(sel2);
                    //	temp.Trsel2 = Translator(temp.sel2_txt, TranslateSite);
                    //}

                    ScenarioList.Add(temp);

                    this.ProgressStatus.Current++;
                    this.ProgressBar();
                }
                this.TranslatieEnd();
            }
            else
            {
                foreach (dynamic detail in Details)
                {
                    string   dtl  = detail.detail;
                    string   sel1 = detail.sel1_txt;
                    string   sel2 = detail.sel2_txt;
                    Scenario temp = new Scenario
                    {
                        context = RemoveWebTag(dtl),
                        index   = detail.id,
                    };
                    if (ScenarioList.Count == 0)
                    {
                        temp.PathName = PathName;
                    }

                    if (detail.charcter1_name != "null")
                    {
                        temp.Name = detail.charcter1_name;
                    }
                    else
                    {
                        temp.Name = "";
                    }

                    if (!ScenarioTransDisabled)
                    {
                        temp.TrName = GrandcypherClient.Current.Translations.ReplaceTranslation(temp.Name);

                        temp.TrContext = GrandcypherClient.Current.Translations.ReplaceTranslation(temp.context);
                        temp.TrContext = Translator(temp.TrContext, TranslateSite);
                        if (temp.TrContext != null)
                        {
                            temp.TrContext = temp.TrContext.Replace("정액", "");
                        }

                        if (sel1 != null)
                        {
                            temp.sel1_txt = RemoveWebTag(sel1);
                            temp.Trsel1   = Translator(temp.sel1_txt, TranslateSite);
                        }
                        if (sel2 != null)
                        {
                            temp.sel2_txt = RemoveWebTag(sel2);
                            temp.Trsel2   = Translator(temp.sel2_txt, TranslateSite);
                        }
                        #region Debug
#if DEBUG
                        Console.WriteLine("-----------------------------------------------------------");

                        Console.WriteLine(temp.Name + " : " + RemoveWebTag(temp.context));
                        Console.WriteLine(temp.TrName + " : " + temp.TrContext);
                        if (temp.sel1_txt != null)
                        {
                            Console.WriteLine(temp.sel1_txt);
                            Console.WriteLine(temp.Trsel1);
                        }
                        if (temp.sel2_txt != null)
                        {
                            Console.WriteLine(temp.sel2_txt);
                            Console.WriteLine(temp.Trsel2);
                        }
#endif
                        #endregion
                    }

                    ScenarioList.Add(temp);

                    this.ProgressStatus.Current++;
                    this.ProgressBar();
                }
                this.TranslatieEnd();
                if (!ScenarioTransDisabled)
                {
                    GrandcypherClient.Current.Translations.WriteFile(ScenarioList, TranslateSite);
                }
                else
                {
                    GrandcypherClient.Current.Translations.WriteFile(ScenarioList, TranslateKind.Raw);
                }
            }
        }
Beispiel #5
0
 public void AddScenario(Scenario scenario)
 {
     ScenarioList.Add(scenario);
 }