Esempio n. 1
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);

            while (true)
            {
                var nameId = file.ReadUInt16();

                if (nameId == 0)
                {
                    break;
                }

                var typeId = file.ReadUInt16();
                var lsize  = file.ReadUInt32();

                var typename = cr2w.strings[typeId].str;

                var variable = CR2WTypeManager.Get().GetByName(typename, "", cr2w);
                variable.Read(file, lsize - 4);

                variable.typeId = typeId;
                variable.nameId = nameId;

                parameters.Add(variable);
            }
        }
Esempio 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);
            }
        }
Esempio n. 3
0
        public override void Read(BinaryReader file, uint size)
        {
            var typepos = file.BaseStream.Position;
            var typeId  = file.ReadUInt16();

            var varsize  = file.ReadUInt32() - 4;
            var typename = cr2w.strings[typeId].str;
            var varname  = cr2w.strings[nameId].str;

            var = CR2WTypeManager.Get().GetByName(typename, varname, cr2w);
            var.Read(file, varsize);

            var.nameId = nameId;
            var.typeId = typeId;
        }
Esempio 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, 0);

                AddVariable(var);
            }
        }
Esempio n. 5
0
 public static CR2WTypeManager Get()
 {
     return(instance ?? (instance = new CR2WTypeManager()));
 }