Ejemplo n.º 1
0
 public CSectorData(CR2WFile cr2w)
     : base(cr2w)
 {
     Unknown1 = new CUInt32(cr2w)
     {
         Name = "unknown1",
         Type = "UInt32"
     };
     Unknown2 = new CUInt32(cr2w)
     {
         Name = "unknown2",
         Type = "UInt32"
     };
     Resources = new CVector(cr2w)
     {
         Name = "resources",
         Type = "CSectorDataResource[]"
     };
     Objects = new CVector(cr2w)
     {
         Name = "objects",
         Type = "CSectorDataObject[]"
     };
     BlockData = new CByteArray(cr2w)
     {
         Name = "blockData",
         Type = "byte[]"
     };
 }
Ejemplo n.º 2
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);

            var count = file.ReadInt32();

            for (var i = 0; i < count; i++)
            {
                var elementsize = file.ReadUInt32();
                //var nameId = file.ReadUInt16();
                var typeId   = file.ReadUInt16();
                var typeName = cr2w.strings[typeId].str;
                //var varname = cr2w.strings[nameId].str;

                var item = CR2WTypeManager.Get().GetByName(typeName, typeName, cr2w, false);
                if (item == null)
                {
                    item = new CVector(cr2w);
                }


                item.Read(file, elementsize);
                item.Type = typeName;
                item.Name = typeName;
                entries.Add(item);
            }
        }
Ejemplo n.º 3
0
        public CEntity(CR2WFile cr2w) : base(cr2w)
        {
            components = new CArray("[]handle:Component", "handle:Component", true, cr2w)
            {
                Name = "components"
            };

            buffer_v1 = new CVector(cr2w)
            {
                Name = "Buffer_v1"
            };
            buffer_v2 = new CBufferUInt32 <CEntityBufferType2>(cr2w, _ => new CEntityBufferType2(_))
            {
                Name = "Buffer_v2"
            };
        }
Ejemplo n.º 4
0
        public override void Read(BinaryReader file, uint size)
        {
            var count = file.ReadUInt32();

            for (var i = 0; i < count; i++)
            {
                var var = CR2WTypeManager.Get().GetByName(elementtype, i.ToString(), cr2w, false);
                if (var == null)
                {
                    var = new CVector(cr2w);
                }
                var.Read(file, size);

                AddVariable(var);
            }
        }