public EntityDefinition getChildDefinition()
        {
            int childId = -1;

            if (varBitId != -1)
            {
                VarBit varBit   = VarBit.values[varBitId];
                int    configId = varBit.configId;
                int    lsb      = varBit.leastSignificantBit;
                int    msb      = varBit.mostSignificantBit;

                //TODO: Make this config stuff, not something in Client.
                int bit = ConstantData.GetBitfieldMaxValue(msb - lsb);
                childId = clientInstance.GetInterfaceSettings(configId) >> lsb & bit;
            }
            else if (settingId != -1)
            {
                childId = clientInstance.GetInterfaceSettings(settingId);
            }

            if (childId < 0 || childId >= childrenIDs.Length || childrenIDs[childId] == -1)
            {
                return(null);
            }
            else
            {
                return(getDefinition(childrenIDs[childId]));
            }
        }
Beispiel #2
0
        public GameObjectDefinition getChildDefinition()
        {
            int child = -1;

            if (varBitId != -1)
            {
                VarBit varBit   = VarBit.values[varBitId];
                int    configId = varBit.configId;
                int    lsb      = varBit.leastSignificantBit;
                int    msb      = varBit.mostSignificantBit;
                int    bit      = ConstantData.GetBitfieldMaxValue(msb - lsb);
                child = clientInstance.GetInterfaceSettings(configId) >> lsb & bit;
            }
            else if (configIds != -1)
            {
                child = clientInstance.GetInterfaceSettings(configIds);
            }

            if (child < 0 || child >= childIds.Length || childIds[child] == -1)
            {
                return(null);
            }
            else
            {
                return(getDefinition(childIds[child]));
            }
        }