예제 #1
0
파일: Main.cs 프로젝트: ElementW/tinke
        public sFolder Unpack(sFile file)
        {
            BinaryReader br  = new BinaryReader(File.OpenRead(file.path));
            string       ext = new String(br.ReadChars(4));

            br.Close();

            if (ext == "NPCK")
            {
                return(NPCK.Unpack(file.path, file.name));
            }
            else if (ext == "KPCN")
            {
                return(KPCN.Unpack(file.path, file.name));
            }
            else if (ext == "spdl")
            {
                return(SPDL.Unpack(file));
            }
            else if (ext == "WMAP")
            {
                return(WMAP.Unpack(file.path, file.name));
            }

            return(new sFolder());
        }
예제 #2
0
        public String Pack(ref sFolder unpacked, sFile file)
        {
            BinaryReader br  = new BinaryReader(File.OpenRead(file.path));
            string       ext = new String(br.ReadChars(4));

            br.Close();

            if (ext == "NPCK")
            {
                string fileOut = pluginHost.Get_TempFile();

                NPCK.Pack(fileOut, ref unpacked, pluginHost);
                return(fileOut);
            }
            else if (ext == "KPCN")
            {
                string fileOut = pluginHost.Get_TempFile();

                KPCN.Pack(fileOut, file.path, ref unpacked, pluginHost);
                return(fileOut);
            }
            else if (ext == "spdl")
            {
                string fileOut = pluginHost.Get_TempFile();

                SPDL.Pack(fileOut, file.path, ref unpacked, pluginHost);
                return(fileOut);
            }

            return(null);
        }