public po2Binary() { size = 0; BP = new Binary2Po(); HeaderBlocks = new ArrayList(); Blocks = new ArrayList(); }
public static void ExportDat(string name, string path, string outFile) { var nodo = NodeFactory.FromFile(path); //BinaryFormat Node nodoPo = null; IConverter <BinaryFormat, Po> nodeConverter = null; Console.WriteLine(@"Exporting " + name + @"..."); switch (name) { //Disgaea 1 case "TALK.DAT": nodeConverter = new TALKDAT.Binary2Po(); break; case "SCRIPT.DAT": IConverter <BinaryFormat, SCRIPT.DAT.SCRIPT> scriptConverter = new SCRIPT.DAT.BinaryFormat2Script(); Node nodoScript = nodo.Transform(scriptConverter); IConverter <SCRIPT.DAT.SCRIPT, Po> poConverter = new SCRIPT.DAT.Script2po(); nodoPo = nodoScript.Transform(poConverter); break; case "CHAR_E.DAT": nodeConverter = new DAT.Binary2po_CHAR_E(); break; case "CHARHELP.DAT": nodeConverter = new DAT.Binary2po_CHARHELP(); break; case "DUNGEON.DAT": nodeConverter = new DAT.Binary2po_DUNGEON(); break; case "GE.DAT": nodeConverter = new DAT.Binary2po_GE(); break; case "GEOCUBE.DAT": nodeConverter = new DAT.Binary2po_GEOCUBE(); break; case "HABIT.DAT": nodeConverter = new DAT.Binary2po_HABIT(); break; case "MAGIC.DAT": nodeConverter = new DAT.Binary2po_MAGIC(); break; case "MITEM.DAT": nodeConverter = new DAT.Binary2po_MITEM(); break; case "MUSICSHOP.DAT": nodeConverter = new DAT.Binary2po_MUSICSHOP(); break; case "THIEF.DAT": nodeConverter = new DAT.Binary2po_THIEF(); break; case "WISH.DAT": nodeConverter = new DAT.Binary2po_WISH(); break; case "ZUKAN.DAT": nodeConverter = new DAT.Binary2po_ZUKAN(); break; default: throw new DatNotSupported(); } if (name != "SCRIPT.DAT") { nodoPo = nodo.Transform(nodeConverter); } nodoPo?.Transform <Po2Binary, Po, BinaryFormat>().Stream.WriteTo(outFile); }