Example #1
0
 public BlockHeaderEntity(BlendValueCapsule value)
     : base(value.GetMember("code").GetAllValueAsString(), value)
 {
     m_address   = Value.GetMember("old_memory_address").GetRawValue <BlendAddress>();
     m_size      = value.GetMember("size").GetRawValue <int>();
     m_sdnaIndex = value.GetMember("sdna_index").GetRawValue <int>();
     m_count     = value.GetMember("count").GetRawValue <int>();
 }
Example #2
0
        /// <summary>
        /// Read value corresponded this type from binary
        /// </summary>
        /// <param name="context">variable for making a value</param>
        /// <returns>value</returns>
        /// <seealso cref="IBlendType.ReadValue"/>
        public BlendValueCapsule ReadValue(ReadValueContext context)
        {
            object obj = null;

            if (GetPointerSizeOf() == 4)
            {
                // 32bit
                obj = new BlendAddress(context.reader.ReadUInt32(), context.mapper);
            }
            else
            {
                // 64bit
                obj = new BlendAddress(context.reader.ReadUInt64(), context.mapper);
            }

            return(new BlendValueCapsule(this, obj));
        }