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); }
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); }
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); }