public void OpenVanillaFile6() { var cat = new CatFile(Path.Combine(_BaseDir, "VanillaEnvironment")); using var ms = cat.TryOpenFile("libraries/not_exist.txt"); Assert.Null(ms); }
public void OpenIndexFile2() { var ex = Assert.Throws <FileNotFoundException>(() => { var cat = new CatFile(Path.Combine(_BaseDir, "VanillaIndexXml")); var xml1 = cat.OpenIndexXml("index/macros.xml", "not_exists_macro"); }); }
public void OpenIndexFile1() { var cat = new CatFile(Path.Combine(_BaseDir, "VanillaIndexXml")); var xml1 = cat.OpenIndexXml("index/macros.xml", "foo_macro"); var xml2 = XDocument.Load(MakePath("VanillaIndexXmlOrig/01/assets/fx/macros/foo_macro.xml")); Assert.True(XNode.DeepEquals(xml1, xml2)); }
public void OpenModFile2() { var cat = new CatFile(Path.Combine(_BaseDir, "PlaneFileModEnvironment")); using var ms = cat.OpenFile("libraries/foo_mod_personal_infomation/personal_infomation.xml"); using var fs = File.OpenRead(MakePath("PlaneFileModEnvironment/extensions/foo_mod/libraries/foo_mod_personal_infomation/personal_infomation.xml")); Assert.True(IsSameStream(ms, fs)); }
public void OpenVanillaFile3() { var cat = new CatFile(Path.Combine(_BaseDir, "VanillaEnvironment")); using var ms = cat.OpenFile("libraries/personal infomation/personal_infomation.xml"); using var fs = File.OpenRead(MakePath("VanillaEnvironmentOrig/01/libraries/personal infomation/personal_infomation.xml")); Assert.True(IsSameStream(ms, fs)); }
public void OpenIndexFile3() { var cat = new CatFile(Path.Combine(_BaseDir, "ModIndexXml")); var xml1 = cat.OpenIndexXml("index/macros.xml", "baz_macro"); var xml2 = XDocument.Load(MakePath("ModIndexXmlOrig/extensions/baz_mod/ext_01/assets/fx/macros/baz_macro.xml")); Assert.True(XNode.DeepEquals(xml1, xml2)); }
public void OpenVanillaFile5() { var ex = Assert.Throws <FileNotFoundException>(() => { var cat = new CatFile(Path.Combine(_BaseDir, "VanillaEnvironment")); using var ms = cat.OpenFile("libraries/not_exist.txt"); }); Assert.Contains("libraries/not_exist.txt", ex.Message); }
/// <summary> /// 言語一覧を更新 /// </summary> public (bool success, IEnumerable <LangComboboxItem> languages) GetLanguages(string inDirPath) { try { var catFiles = new CatFile(inDirPath); var xml = catFiles.OpenXml("libraries/languages.xml"); var languages = xml.XPathSelectElements("/languages/language") .Select(x => new LangComboboxItem(int.Parse(x.Attribute("id").Value), x.Attribute("name").Value)) .OrderBy(x => x.ID); return(true, languages); } catch (Exception) { return(false, Enumerable.Empty <LangComboboxItem>()); } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイル</param> /// <param name="resolver">言語解決用オブジェクト</param> public RaceExporter(CatFile catFile, LangageResolver resolver) { _RaceXml = catFile.OpenXml("libraries/races.xml"); _Resolver = resolver; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイルオブジェクト</param> /// <param name="waresXml">ウェア情報xml</param> /// <param name="resolver">言語解決用オブジェクト</param> public EquipmentExporter(CatFile catFile, XDocument waresXml, LangageResolver resolver) { _CatFile = catFile; _WaresXml = waresXml; _Resolver = resolver; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイルオブジェクト</param> /// <param name="waresXml">ウェア情報xml</param> public ModuleTurretExporter(CatFile catFile, XDocument waresXml) { _CatFile = catFile; _WaresXml = waresXml; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイルオブジェクト</param> /// <param name="waresXml">ウェア情報xml</param> public ModuleStorageExporter(CatFile catFile, XDocument waresXml) { _CatFile = catFile; _WaresXml = waresXml; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイルオブジェクト</param> /// <param name="waresXml">ウェア情報xml</param> public ShipExporter(CatFile catFile, XDocument waresXml) { _CatFile = catFile; _WaresXml = waresXml; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイル</param> /// <param name="resolver">言語解決用オブジェクト</param> public FactionExporter(CatFile catFile, LangageResolver resolver) { _FactionsXml = catFile.OpenXml("libraries/factions.xml"); _Resolver = resolver; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイルオブジェクト</param> public LangageResolver(CatFile catFile) { _CatFile = catFile; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイル</param> /// <param name="resolver">言語解決用オブジェクト</param> public WareGroupExporter(CatFile catFile, LangageResolver resolver) { _WareGroupXml = catFile.OpenXml("libraries/waregroups.xml"); _Resolver = resolver; }
public void X4Version() { var cat = new CatFile(Path.Combine(_BaseDir, "VanillaEnvironment")); Assert.Equal("330", cat.Version); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="raceXml">catファイルオブジェクト</param> /// <param name="resolver">言語解決用オブジェクト</param> public RaceExporter(CatFile catFile, ILanguageResolver resolver) { _CatFile = catFile; _Resolver = resolver; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイル</param> /// <param name="resolver">言語解決用オブジェクト</param> public MapExporter(CatFile catFile, LangageResolver resolver) { _MapXml = catFile.OpenXml("libraries/mapdefaults.xml"); _Resolver = resolver; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="catFile">catファイルオブジェクト</param> /// <param name="resolver">言語解決用オブジェクト</param> public FactionExporter(CatFile catFile, ILanguageResolver resolver) { _CatFile = catFile; _Resolver = resolver; }