Beispiel #1
0
        public override void OnPopulate()
        {
            if (Header->_propertyPtr != 0 && Header->_propertyCount > 0)
            {
                HavokGroupNode memberGroup = new HavokGroupNode()
                {
                    _name = "Members"
                };
                memberGroup.Parent = this;
                hkClassMember *member = (hkClassMember *)Header->_propertyPtr.OffsetAddress;
                for (int i = 0; i < Header->_propertyCount; i++, member++)
                {
                    new hkClassMemberNode().Initialize(memberGroup, member, 20);
                }
            }

            if (Header->_enumPtr != 0 && Header->_enumCount > 0)
            {
                HavokGroupNode enumGroup = new HavokGroupNode()
                {
                    _name = "Enums"
                };
                enumGroup.Parent = this;
                hkClassEnum *Enum = (hkClassEnum *)Header->_enumPtr.OffsetAddress;
                for (int i = 0; i < Header->_enumCount; i++, Enum++)
                {
                    new hkClassEnumNode().Initialize(enumGroup, Enum, 16);
                }
            }

            if (Header->_attribPtr != 0)
            {
                hkCustomAttributes *attribHeader = (hkCustomAttributes *)Header->_attribPtr.OffsetAddress;
                if (attribHeader->_count > 0)
                {
                    HavokGroupNode attribGroup = new HavokGroupNode()
                    {
                        _name = "Attributes"
                    };
                    attribGroup.Parent = this;
                    HavokAttribute *attrib = (HavokAttribute *)attribHeader->_attribPtr.OffsetAddress;
                    for (int i = 0; i < attribHeader->_count; i++, attrib++)
                    {
                        new HavokAttributeNode().Initialize(attribGroup, attrib, 12);
                    }
                }
            }
        }
Beispiel #2
0
        public override bool OnInitialize()
        {
            if (Header->_namePtr > 0)
            {
                _name = new string((sbyte *)Header->_namePtr.OffsetAddress);
            }

            _interfaceCount = Header->_interfaceCount;
            _enumCount      = Header->_enumCount;
            _memberCount    = Header->_propertyCount;
            _version        = Header->_version;
            _size           = Header->_size;
            _flags          = Header->_flags;
            _defaultsPtr    = Header->_defaultsPtr;

            if (Header->_parentPtr != 0)
            {
                hkClass *parent = (hkClass *)Header->_parentPtr.OffsetAddress;
                _parentName = new string((sbyte *)parent->_namePtr.OffsetAddress);
            }

            int attribCount = 0;

            if (Header->_attribPtr != 0)
            {
                hkCustomAttributes *attribHeader = (hkCustomAttributes *)Header->_attribPtr.OffsetAddress;
                attribCount = attribHeader->_count;
            }

            if (Header->_defaultsPtr != 0)
            {
                Console.WriteLine(Name + " has defaults");
            }

            SetSizeInternal(48);

            return(Header->_propertyCount > 0 || Header->_enumCount > 0 || attribCount > 0);
        }