Exemplo n.º 1
0
        // reads a class body
        ConfigClass ReadClassBody(string name, long bodyOffset)
        {
            // Class bodies are distributed separately from their definitions
            // so before we go looking we need to take note of where we started
            var currentOffset = _input.Position;

            //read the parent name
            _input.Seek(bodyOffset, SeekOrigin.Begin);
            var parentName = BinaryFile.ReadString(_input);
            var cfgClass   = new ConfigClass(name, parentName);

            //read all entries in the class body
            var entryCount = BinaryFile.ReadCompressedInteger(_input);

            for (var c = 0; c < entryCount; c++)
            {
                cfgClass.Add(ReadConfigEntry());
            }
            //ensure we haven't disturbed the seek position
            _input.Seek(currentOffset, SeekOrigin.Begin);
            return(cfgClass);
        }
Exemplo n.º 2
0
 static void BinariseEnum(MemoryStream mem, string name, long val)
 {
     BinaryFile.WriteString(mem, name);
     BinaryFile.WriteUInt32(mem, (UInt32)val);
 }
Exemplo n.º 3
0
 static void BinariseDelete(MemoryStream mem, string name)
 {
     BinaryFile.WriteByte(mem, 4);
     BinaryFile.WriteString(mem, name);
 }
Exemplo n.º 4
0
 static void BinariseExtern(MemoryStream mem, string name)
 {
     BinaryFile.WriteByte(mem, 3);
     BinaryFile.WriteString(mem, name);
 }
Exemplo n.º 5
0
 static void BinariseEmbeddedArray(MemoryStream mem)
 {
     BinaryFile.WriteByte(mem, 3);
 }
Exemplo n.º 6
0
 static void BinariseEmbedded(MemoryStream mem, UInt32 n)
 {
     BinaryFile.WriteByte(mem, 2);
     BinaryFile.WriteUInt32(mem, n);
 }
Exemplo n.º 7
0
 static void BinariseEmbedded(MemoryStream mem, float n)
 {
     BinaryFile.WriteByte(mem, 1);
     BinaryFile.WriteFloat32(mem, n);
 }
Exemplo n.º 8
0
 static void BinariseEmbedded(MemoryStream mem, string n)
 {
     BinaryFile.WriteByte(mem, 0);
     BinaryFile.WriteString(mem, n);
 }
Exemplo n.º 9
0
 static void BinariseArray(MemoryStream mem, string name, int n)
 {
     BinaryFile.WriteByte(mem, 2);
     BinaryFile.WriteString(mem, name);
     BinaryFile.WriteCompressedInteger(mem, n);
 }
Exemplo n.º 10
0
 static void BinariseClassBody(MemoryStream mem, string parent, int n)
 {
     BinaryFile.WriteString(mem, parent);
     BinaryFile.WriteCompressedInteger(mem, n);
 }
Exemplo n.º 11
0
 static void BinariseClass(MemoryStream mem, string name, UInt32 offset)
 {
     BinaryFile.WriteByte(mem, 0);
     BinaryFile.WriteString(mem, name);
     BinaryFile.WriteUInt32(mem, offset);
 }
Exemplo n.º 12
0
        DeleteReference ReadConfigDelete()
        {
            var className = BinaryFile.ReadString(_input);

            return(new DeleteReference(className));
        }
Exemplo n.º 13
0
        ExternReference ReadConfigExtern()
        {
            var className = BinaryFile.ReadString(_input);

            return(new ExternReference(className));
        }
Exemplo n.º 14
0
        IntProperty ReadConfigInt(string name)
        {
            var value = BinaryFile.ReadInt32(_input);

            return(new IntProperty(name, value));
        }
Exemplo n.º 15
0
        FloatProperty ReadConfigFloat(string name)
        {
            var value = BinaryFile.ReadFloat32(_input);

            return(new FloatProperty(name, value));
        }
Exemplo n.º 16
0
        StringProperty ReadConfigString(string name)
        {
            var value = BinaryFile.ReadString(_input);

            return(new StringProperty(name, value));
        }