예제 #1
0
        public override void Write(BinaryWriter file)
        {
            throw new NotImplementedException();//TODO
            base.Write(file);
            var count = new CDynamicInt(cr2w);

            count.val = Trees.Count();
            foreach (var current in Trees.array)
            {
                /*
                 * treetype.Read(file, 4);
                 * currenttreebundle.Name = treetype.Handle;
                 * currentTrees.AddVariable(treetype);
                 * treecount.Read(file, 1);
                 * for (int i = 0; i < treecount.val; i++)
                 * {
                 *  CTree tree = new CTree(cr2w);
                 *  tree.Read(file, 29);
                 *  currentTrees.AddVariable(tree);
                 * }
                 * currenttreebundle.AddVariable(currentTrees);
                 * Trees.AddVariable(currenttreebundle);*/
            }
            file.Write(0x80); //END
        }
예제 #2
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);
            CDynamicInt count = new CDynamicInt(cr2w);

            count.Read(file, 1);
            for (int j = 0; j < count.val; j++)
            {
                CArray  currenttreebundle = new CArray(cr2w);
                CHandle treetype          = new CHandle(cr2w);
                treetype.Read(file, 4);
                currenttreebundle.Name = treetype.Handle;
                CArray currentTrees = new CArray(cr2w);
                currentTrees.AddVariable(treetype);
                CDynamicInt treecount = new CDynamicInt(cr2w);
                treecount.Read(file, 1);
                for (int i = 0; i < treecount.val; i++)
                {
                    CTree tree = new CTree(cr2w);
                    tree.Read(file, 29);
                    currentTrees.AddVariable(tree);
                }
                currenttreebundle.AddVariable(currentTrees);
                Trees.AddVariable(currenttreebundle);
            }
            file.BaseStream.Seek(1, SeekOrigin.Current);
        }
예제 #3
0
        public override void Read(BinaryReader file, uint size)
        {
            CDynamicInt count = new CDynamicInt(cr2w, null, "");
            count.Read(file, size);

            base.Read(file, size, count.val);

            padding.Read(file, 4);
        }
예제 #4
0
        public override void Write(BinaryWriter file)
        {
            CDynamicInt count = new CDynamicInt(cr2w, null, "")
            {
                val = elements.Count
            };

            count.Write(file);

            base.Write(file);
        }
예제 #5
0
        public override void Write(BinaryWriter file)
        {
            CDynamicInt count = new CDynamicInt(cr2w);

            count.val = elements.Count;
            count.Write(file);

            foreach (var element in elements)
            {
                element.Write(file);
            }
        }
예제 #6
0
        public override void Read(BinaryReader file, uint size)
        {
            CDynamicInt count = new CDynamicInt(cr2w);

            count.Read(file, size);

            for (int i = 0; i < count.val; i++)
            {
                T element = elementFactory.Invoke(cr2w);
                element.Name = i.ToString();
                element.Read(file, size);
                elements.Add(element);
            }
        }
예제 #7
0
 public CFXTrackItem(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name)
 {
     buffername = new CName(cr2w, this, nameof(buffername))
     {
         IsSerialized = true
     };
     count = new CDynamicInt(cr2w, this, nameof(count))
     {
         IsSerialized = true
     };
     unk = new CUInt8(cr2w, this, nameof(unk))
     {
         IsSerialized = true
     };
     buffer = new CCompressedBuffer <CBufferUInt16 <CFloat> >(cr2w, this, nameof(buffer))
     {
         IsSerialized = true
     };
 }
예제 #8
0
 public CFXTrackItem(CR2WFile cr2w) :
     base(cr2w)
 {
     buffername = new CName(cr2w)
     {
         Name = "buffername"
     };
     count = new CDynamicInt(cr2w)
     {
         Name = "count"
     };
     unk = new CUInt8(cr2w)
     {
         Name = "unk"
     };
     buffer = new CCompressedBuffer <CBufferUInt16 <CFloat> >(cr2w, _ => new CBufferUInt16 <CFloat>(_, x => new CFloat(x)))
     {
         Name = "buffer"
     };
 }
예제 #9
0
 public CLayerGroup(CR2WFile cr2w) : base(cr2w)
 {
     World = new CHandle(cr2w)
     {
         Name = "WorldParent"
     };
     LayergroupParent = new CHandle(cr2w)
     {
         Name = "LayergroupParent"
     };
     NumGroups      = new CDynamicInt(cr2w);
     ChildrenGroups = new CArray(cr2w)
     {
         Name = "ChildrenGroups"
     };
     NumInfos      = new CDynamicInt(cr2w);
     ChildrenInfos = new CArray(cr2w)
     {
         Name = "ChildrenInfos"
     };
 }