public static void TEST_LYNDUMP_TEST2() { string[] lines = File.ReadAllLines(Program.GetTestData("SaveUnitExpanded.lyn.event")); EAUtilLynDumpMode lyn = new EAUtilLynDumpMode(); foreach (string l in lines) { bool r = lyn.ParseLine(l); if (!r) { break; } } Debug.Assert(lyn.List.Count == 9); Debug.Assert(lyn.List[0].Name == "NONAME"); Debug.Assert(lyn.List[0].Start == 0); Debug.Assert(lyn.List[0].StartLow == 0); Debug.Assert(lyn.List[1].Name == "ESU_SaveGameUnits"); Debug.Assert(lyn.List[1].Start == 0x274); Debug.Assert(lyn.List[1].StartLow == 0x275); Debug.Assert(lyn.List[2].Name == "ESU_LoadGameUnits"); Debug.Assert(lyn.List[2].Start == 0x2BC); Debug.Assert(lyn.List[2].StartLow == 0x2BD); Debug.Assert(lyn.List[3].Name == "ESU_SavePlayerSuspendUnits"); Debug.Assert(lyn.List[3].Start == 0x304); Debug.Assert(lyn.List[3].StartLow == 0x305); Debug.Assert(lyn.List[4].Name == "ESU_LoadPlayerSuspendUnits"); Debug.Assert(lyn.List[4].Start == 0x34C); Debug.Assert(lyn.List[4].StartLow == 0x34D); Debug.Assert(lyn.List[5].Name == "ESU_SaveGreenSuspendUnits"); Debug.Assert(lyn.List[5].Start == 0x394); Debug.Assert(lyn.List[5].StartLow == 0x395); Debug.Assert(lyn.List[6].Name == "ESU_LoadGreenSuspendUnits"); Debug.Assert(lyn.List[6].Start == 0x3DC); Debug.Assert(lyn.List[6].StartLow == 0x3DD); Debug.Assert(lyn.List[7].Name == "ESU_SaveRedSuspendUnits"); Debug.Assert(lyn.List[7].Start == 0x424); Debug.Assert(lyn.List[7].StartLow == 0x425); Debug.Assert(lyn.List[8].Name == "ESU_LoadRedSuspendUnits"); Debug.Assert(lyn.List[8].Start == 0x46C); Debug.Assert(lyn.List[8].StartLow == 0x46D); Debug.Assert(lyn.Bin.Count == 0x4B4); }
void AddLynDump(EAUtilLynDumpMode lyn, string filename) { if (lyn.GetCount() == 0) {//ORG指定がない場合 if (filename == "") { filename = "LYNDUMP"; } Data data = new Data(filename, this.Dir, lyn.GetDataAll(), DataEnum.LYN, 0); this.DataList.Add(data); return; } int count = lyn.GetCount(); for (int i = 0; i < count; i++) { Data data = new Data("LYNDUMP_" + lyn.GetName(i), lyn.GetData(i), DataEnum.LYN, 0); this.DataList.Add(data); } }
bool ParseLynInclude(string line, string orignalIine) { int start = line.IndexOf("#include"); if (start < 0) { return(false); } int lyn_event_pos = line.IndexOf("lyn.event", start); if (lyn_event_pos < 0) { return(false); } string filename = U.cut(line, "\"", "\""); string fullfilename = Path.Combine(this.Dir, filename); if (!File.Exists(fullfilename)) { return(false); } string[] lines = File.ReadAllLines(fullfilename); EAUtilLynDumpMode lyndmp = new EAUtilLynDumpMode(); foreach (string l in lines) { bool r = lyndmp.ParseLine(l); if (!r) { break; } } //LYNDUMPの終了 AddLynDump(lyndmp); return(true); }
bool ParseLynDump(string line, string orignalIine) { if (this.LynDump == null) { if (line == "") { return(false); } if (orignalIine.IndexOf("// lyn output of ", StringComparison.OrdinalIgnoreCase) >= 0) { this.LynDump = new EAUtilLynDumpMode(); return(true); } else { return(false); } } if (this.LynDump == null) { return(false); } bool r = this.LynDump.ParseLine(line); if (r) {//LYNDUMPの処理を行うので、続きのパースは不要. return(true); } //LYNDUMPの終了 Data data = new Data("LYNDUMP", this.LynDump.GetData(), DataEnum.LYN, 0); this.DataList.Add(data); this.LynDump = null; return(false); }
public static void TEST_LYNDUMP_TEST1() { string[] lines = File.ReadAllLines(Program.GetTestData("DanceAi.lyn.event")); EAUtilLynDumpMode lyn = new EAUtilLynDumpMode(); foreach (string l in lines) { bool r = lyn.ParseLine(l); if (!r) { break; } } Debug.Assert(lyn.List.Count == 2); Debug.Assert(lyn.List[0].Name == "DanceAiTryDecide"); Debug.Assert(lyn.List[0].Start == 0); Debug.Assert(lyn.List[0].StartLow == 1); Debug.Assert(lyn.List[1].Name == "DanceAiDoAction"); Debug.Assert(lyn.List[1].Start == 0x138); Debug.Assert(lyn.List[1].StartLow == 0x139); }
bool ParseLynDump(string line, string orignalIine) { if (this.LynDump == null) { if (line == "") { return(false); } if (orignalIine.IndexOf("// lyn output of ", StringComparison.OrdinalIgnoreCase) >= 0) { this.LynDump = new EAUtilLynDumpMode(); return(true); } else { return(false); } } if (this.LynDump == null) { return(false); } bool r = this.LynDump.ParseLine(line); if (r) {//LYNDUMPの処理を行うので、続きのパースは不要. return(true); } //LYNDUMPの終了 AddLynDump(this.LynDump); this.LynDump = null; return(false); }