private static void LoadData() { AutoTranslator.Data_ = new MessageGroupCollection(); try { string DataFilePath = Path.Combine(POL.GetApplicationPath(AppID.FFXI), "ROM/76/23.DAT"); FileStream FS = new FileStream(DataFilePath, FileMode.Open, FileAccess.Read, FileShare.Read); Encoding E = new FFXIEncoding(); BinaryReader BR = new BinaryReader(FS, E); while (FS.Position < FS.Length) { AutoTranslator.Data_.Add(AutoTranslator.ReadMessageGroup(BR, E)); } BR.Close(); } catch (Exception E) { Console.WriteLine(E.ToString()); } }
private static MessageGroup ReadMessageGroup(BinaryReader BR, Encoding E) { MessageGroup MG = new MessageGroup(); MG.Category = BR.ReadByte(); MG.Language = BR.ReadByte(); MG.ID = BR.ReadByte(); MG.ParentGroup = BR.ReadByte(); MG.Title = E.GetString(BR.ReadBytes(32)).TrimEnd('\0'); MG.Description = E.GetString(BR.ReadBytes(32)).TrimEnd('\0'); uint MessageCount = BR.ReadUInt32(); /* MessageBytes */ BR.ReadUInt32(); for (int i = 0; i < MessageCount; ++i) { MG.Messages.Add(AutoTranslator.ReadMessage(BR, E)); } return(MG); }
public void Remove(AutoTranslator.MessageGroup MG) { this.InnerList.Remove (MG); }
public int IndexOf(AutoTranslator.MessageGroup MG) { return this.InnerList.IndexOf (MG); }
public bool Contains(AutoTranslator.MessageGroup MG) { return this.InnerList.Contains(MG); }
public void Add(AutoTranslator.MessageGroup MG) { this.InnerList.Add (MG); }
public void Remove(AutoTranslator.Message M) { this.InnerList.Remove (M); }
public int IndexOf(AutoTranslator.Message M) { return this.InnerList.IndexOf (M); }
public void Add(AutoTranslator.Message M) { this.InnerList.Add (M); }