/// <summary> /// 言語情報ファイルを読み込み、言語情報を返す。 /// </summary> /// <param name="path">言語情報ファイル</param> /// <returns>言語情報</returns> public static FssLanguageInfo LoadFromFile(string path) { var fssLanguageInfo = new FssLanguageInfo(); using (var reader = new BinaryReader(File.OpenRead(path), Encoding.UTF8)) { var fssLanguageHeader = FssLanguageHeader.Read(reader); var fssLanguageFile = FssLanguageFile.Read(reader); var fssLanguageFooter = FssLanguageFooter.Read(reader); fssLanguageInfo.SetHeader(fssLanguageHeader); fssLanguageInfo.SetFile(fssLanguageFile); fssLanguageInfo.SetFooter(fssLanguageFooter); } return(fssLanguageInfo); }
/// <summary> /// Streamからデータを読み込み、言語ヘッダーを返す。 /// </summary> /// <param name="br">Stream</param> /// <returns>言語ヘッダー</returns> public static FssLanguageHeader Read(BinaryReader br) { var fssLanguageHeader = new FssLanguageHeader(); fssLanguageHeader.GameObjectFileID = br.ReadInt32(); fssLanguageHeader.GameObjectPathID = br.ReadInt64(); fssLanguageHeader.Enabled = FsbBinUtils.ReadBoolean(br); fssLanguageHeader.ScriptFileID = br.ReadInt32(); fssLanguageHeader.ScriptPathID = br.ReadInt64(); fssLanguageHeader.Name = FsbBinUtils.ReadString(br); fssLanguageHeader.GoogleWebServiceURL = FsbBinUtils.ReadString(br); fssLanguageHeader.GoogleSpreadsheetKey = FsbBinUtils.ReadString(br); fssLanguageHeader.GoogleSpreadsheetName = FsbBinUtils.ReadString(br); fssLanguageHeader.GoogleLastUpdatedVersion = FsbBinUtils.ReadString(br); fssLanguageHeader.GoogleUpdateFrequency = br.ReadInt32(); return(fssLanguageHeader); }
/// <summary> /// 自分自身のクローンを返す。 /// </summary> /// <returns>自分自身のクローン</returns> public FssLanguageHeader Clone() { var languageHeader = new FssLanguageHeader() { GameObjectFileID = this.GameObjectFileID, GameObjectPathID = this.GameObjectPathID, Enabled = this.Enabled, ScriptFileID = this.ScriptFileID, ScriptPathID = this.ScriptPathID, Name = this.Name, GoogleWebServiceURL = this.GoogleWebServiceURL, GoogleSpreadsheetKey = this.GoogleSpreadsheetKey, GoogleSpreadsheetName = this.GoogleSpreadsheetName, GoogleLastUpdatedVersion = this.GoogleLastUpdatedVersion, GoogleUpdateFrequency = this.GoogleUpdateFrequency, }; return(languageHeader); }