Exemple #1
0
        /// <summary>
        /// Serializes a the Attributes stored in this Instance to the BinaryStream
        /// </summary>
        /// <param name="writer">The Stream the Data should be stored to</param>
        /// <remarks>
        /// Be sure that the Position of the stream is Proper on
        /// return (i.e. must point to the first Byte after your actual File)
        /// </remarks>
        public override void Serialize(System.IO.BinaryWriter writer)
        {
            writer.Write(version);

            writer.Write(gb.BlockName);
            writer.Write(gb.BlockID);
            gb.Serialize(writer);

            writer.Write(u1);
            writer.Write(u2);
            writer.Write(u3);

            for (int i = 0; i < 10; i++)
            {
                if (i < items.Count)
                {
                    items[i].Serialize(writer);
                }
                else
                {
                    TSFaceGeometryBuilderItem o = new TSFaceGeometryBuilderItem();
                    o.Serialize(writer);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();

            string name = reader.ReadString();
            uint   myid = reader.ReadUInt32();

            gb.Unserialize(reader);
            gb.BlockID = myid;


            u1 = reader.ReadInt32();
            u2 = reader.ReadByte();
            u3 = reader.ReadInt32();

            for (int i = 0; i < 10; i++)
            {
                TSFaceGeometryBuilderItem o = new TSFaceGeometryBuilderItem();
                o.Unserialize(reader);
                if (items.Count <= i)
                {
                    items.IntAdd(o);
                }
                else
                {
                    items[i] = o;
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Checks wether or not the object is already stored in the List
 /// </summary>
 /// <param name="item">The Object you are looking for</param>
 /// <returns>true, if it was found</returns>
 public bool Contains(TSFaceGeometryBuilderItem item)
 {
     return(base.Contains(item));
 }
Exemple #4
0
 /// <summary>
 /// remove an Element
 /// </summary>
 /// <param name="item">The object that should be removed</param>
 public void Remove(TSFaceGeometryBuilderItem item)
 {
     //base.Remove(item);
 }
Exemple #5
0
 /// <summary>
 /// insert a new Element
 /// </summary>
 /// <param name="index">The Index where the Element should be stored</param>
 /// <param name="item">The object that should be inserted</param>
 public void Insert(int index, TSFaceGeometryBuilderItem item)
 {
     //base.Insert(index, item);
 }
Exemple #6
0
 /// <summary>
 /// add a new Element
 /// </summary>
 /// <param name="item">The object you want to add</param>
 /// <returns>The index it was added on</returns>
 internal int IntAdd(TSFaceGeometryBuilderItem item)
 {
     return(base.Add(item));
 }
Exemple #7
0
 /// <summary>
 /// add a new Element
 /// </summary>
 /// <param name="item">The object you want to add</param>
 /// <returns>The index it was added on</returns>
 public int Add(TSFaceGeometryBuilderItem item)
 {
     return(-1);
 }