示例#1
0
        private bool LoadFile( Stream stream, bool isUtf8 = false )
        {
            uint entryCount = stream.ReadUInt32();

            EntryList = new List<ebmEntry>( (int)entryCount );
            for ( uint i = 0; i < entryCount; ++i ) {
                ebmEntry e = new ebmEntry( stream, isUtf8 );
                EntryList.Add( e );
            }

            return true;
        }
示例#2
0
        private bool LoadFile(Stream stream, Util.GameTextEncoding encoding)
        {
            uint entryCount = stream.ReadUInt32();

            EntryList = new List <ebmEntry>((int)entryCount);
            for (uint i = 0; i < entryCount; ++i)
            {
                ebmEntry e = new ebmEntry(stream, encoding);
                EntryList.Add(e);
            }

            return(true);
        }
示例#3
0
文件: ebm.cs 项目: mhwu95/HyoutaTools
        private bool LoadFile(Stream stream, bool isUtf8 = false)
        {
            uint entryCount = stream.ReadUInt32();

            EntryList = new List <ebmEntry>((int)entryCount);
            for (uint i = 0; i < entryCount; ++i)
            {
                ebmEntry e = new ebmEntry(stream, isUtf8);
                EntryList.Add(e);
            }

            return(true);
        }
示例#4
0
        public static int Execute(List <string> args)
        {
            if (args.Count < 2)
            {
                Console.WriteLine("Usage: infile.sqlite outfile.ebm");
                return(-1);
            }

            string infile  = args[0];
            string outfile = args[1];
            var    ebm     = new ebm();

            var rows = SqliteUtil.SelectArray("Data Source=" + infile, "SELECT Ident, Unknown2, Unknown3, CharacterId, Unknown5, Unknown6, Unknown7, Unknown8, Entry FROM ebm ORDER BY ID");

            foreach (var row in rows)
            {
                ebmEntry e = new ebmEntry()
                {
                    Ident       = (uint)(long)row[0],
                    Unknown2    = (uint)(long)row[1],
                    Unknown3    = (uint)(long)row[2],
                    CharacterId = (int)row[3],
                    Unknown5    = (uint)(long)row[4],
                    Unknown6    = (uint)(long)row[5],
                    Unknown7    = (uint)(long)row[6],
                    Unknown8    = (uint)(long)row[7],
                    Text        = (string)row[8],
                };
                ebm.EntryList.Add(e);
            }

            using (Stream s = new FileStream(outfile, FileMode.Create)) {
                ebm.WriteFile(s, TextUtils.GameTextEncoding.UTF8);
                s.Close();
            }

            return(0);
        }