/// <summary> /// Function to add a field to this vertex. /// </summary> /// <param name="stream">Stream to bind this field with.</param> /// <param name="fieldOffset">Offset of this field within the vertex type..</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of the field.</param> /// <param name="index">Index of the field, only required for certain types.</param> public void CreateField(short stream, short fieldOffset, VertexFieldContext context, VertexFieldType fieldType, byte index) { VertexField newField; // A new vertex field. newField = new VertexField(stream, fieldOffset, context, fieldType, index); _fields.Add(newField); _changed = true; _sizeChanged = true; }
/// <summary> /// Function to insert a vertex field at a specified index. /// </summary> /// <param name="stream">Stream to which the field will be bound.</param> /// <param name="fieldIndex">Index after which to insert.</param> /// <param name="fieldOffset">Offset of the field in the buffer.</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of this field.</param> /// <param name="index">Index of the vertex field, required for certain fields.</param> public void InsertField(short stream, int fieldIndex, short fieldOffset, VertexFieldContext context, VertexFieldType fieldType, byte index) { VertexField newField; // New _fields[i]. newField = new VertexField(stream, fieldOffset, context, fieldType, index); _fields.Insert(fieldIndex, newField); _changed = true; _sizeChanged = true; }
/// <summary> /// Function to add a field to this vertex. /// </summary> /// <param name="stream">Stream to bind this field with.</param> /// <param name="fieldOffset">Offset of this field within the vertex type..</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of the field.</param> /// <param name="index">Index of the field, only required for certain types.</param> public void CreateField ( short stream , short fieldOffset , VertexFieldContext context , VertexFieldType fieldType , byte index ) { VertexField newField; // A new vertex field. newField = new VertexField(stream , fieldOffset , context , fieldType , index); _fields.Add(newField); _changed = true; _sizeChanged = true; }
/// <summary> /// Indicates whether this instance and a specified object are equal. /// </summary> /// <param name="obj">Another object to compare to.</param> /// <returns> /// true if obj and this instance are the same type and represent the same value; otherwise, false. /// </returns> public override bool Equals(object obj) { VertexField left = obj as VertexField; // Comparison vertex field. if ((left != null) && ((left._context == _context) && (left._index == _index) && (left._offset == _offset) && (left._stream == _stream) && (left._type == _type))) { return(true); } return(false); }
/// <summary> /// Function to update a vertex _fields[i]. /// </summary> /// <param name="stream">Stream to which the field is bound.</param> /// <param name="fieldIndex">Index of the field to update</param> /// <param name="fieldOffset">Offset within the buffer.</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of the field.</param> /// <param name="index">Index of the field, only required for certain types.</param> public void UpdateField(short stream, int fieldIndex, short fieldOffset, VertexFieldContext context, VertexFieldType fieldType, byte index) { if ((fieldIndex < 0) || (fieldIndex >= _fields.Count)) { throw new IndexOutOfRangeException("The index " + index.ToString() + " is not valid for this collection."); } _fields[fieldIndex] = new VertexField(stream, fieldOffset, context, fieldType, index); _changed = true; _sizeChanged = true; }
/// <summary> /// Function to update a vertex _fields[i]. /// </summary> /// <param name="stream">Stream to which the field is bound.</param> /// <param name="fieldIndex">Index of the field to update</param> /// <param name="fieldOffset">Offset within the buffer.</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of the field.</param> /// <param name="index">Index of the field, only required for certain types.</param> public void UpdateField(short stream, int fieldIndex, short fieldOffset, VertexFieldContext context, VertexFieldType fieldType, byte index) { if ((fieldIndex < 0) || (fieldIndex >= _fields.Count)) { throw new ArgumentOutOfRangeException(nameof(index), index, "Value must be inside " + nameof(fieldIndex)); } _fields[fieldIndex] = new VertexField(stream, fieldOffset, context, fieldType, index); _changed = true; _sizeChanged = true; }
/// <summary> /// Property to return whether a field exists within this type or not. /// </summary> /// <param name="field">Field value.</param> /// <returns>TRUE if it exists, FALSE if not.</returns> public bool Contains(VertexField field) { return(_fields.Contains(field)); }
/// <summary> /// Function to update a vertex _fields[i]. /// </summary> /// <param name="stream">Stream to which the field is bound.</param> /// <param name="fieldIndex">Index of the field to update</param> /// <param name="fieldOffset">Offset within the buffer.</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of the field.</param> /// <param name="index">Index of the field, only required for certain types.</param> public void UpdateField( short stream , int fieldIndex , short fieldOffset , VertexFieldContext context , VertexFieldType fieldType , byte index ) { if ((fieldIndex < 0) || (fieldIndex >= _fields.Count)) throw new IndexOutOfRangeException("The index " + index.ToString() + " is not valid for this collection."); _fields[fieldIndex] = new VertexField(stream , fieldOffset , context , fieldType , index); _changed = true; _sizeChanged = true; }
/// <summary> /// Function to insert a vertex field at a specified index. /// </summary> /// <param name="stream">Stream to which the field will be bound.</param> /// <param name="fieldIndex">Index after which to insert.</param> /// <param name="fieldOffset">Offset of the field in the buffer.</param> /// <param name="context">Context of this field.</param> /// <param name="fieldType">Data type of this field.</param> /// <param name="index">Index of the vertex field, required for certain fields.</param> public void InsertField( short stream , int fieldIndex , short fieldOffset , VertexFieldContext context , VertexFieldType fieldType , byte index ) { VertexField newField; // New _fields[i]. newField = new VertexField(stream , fieldOffset , context , fieldType , index); _fields.Insert(fieldIndex , newField); _changed = true; _sizeChanged = true; }
/// <summary> /// Property to return whether a field exists within this type or not. /// </summary> /// <param name="field">Field value.</param> /// <returns>TRUE if it exists, FALSE if not.</returns> public bool Contains( VertexField field ) { return _fields.Contains(field); }