Examples of TypeField


Examples of info.ata4.unity.asset.struct.TypeField

        }
       
        Set<Integer> classIDs = asset.getClassIDs();
       
        for (Integer classID : classIDs) {
            TypeField classField = typeTree.getFields().get(classID);
           
            // skip filtered classes
            if (cf != null && !cf.accept(classID)) {
                continue;
            }
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeField

        bb.order(ByteOrder.LITTLE_ENDIAN);

        in = DataInputReader.newReader(bb);
       
        Map<Integer, TypeField> typeFields = asset.getTypeTree().getFields();
        TypeField type = typeFields.get(path.getClassID());
       
        // check if the type information is available
        if (type == null) {
            throw new IllegalArgumentException("Class not found in type tree");
        }
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeField

        // there should be exactly two fields in an array object: size and data
        if (subTypes.size() != 2) {
            throw new IOException("Unexpected number of array fields: " + subTypes.size());
        }
       
        TypeField typeSize = subTypes.get(0);
        TypeField typeData = subTypes.get(1);
       
        // check name of the two array fields
        if (!typeSize.getName().equals("size")) {
            throw new IOException("Unexpected array size field: " + typeSize);
        }
       
        if (!typeData.getName().equals("data")) {
            throw new IOException("Unexpected array data field: " + typeData);
        }
       
        // read the size field
        int size = (int) readValue(typeSize);
       
        UnityValue value = new UnityValue();
        value.setType(typeData.getType());
       
        switch (typeData.getType()) {
            // read byte arrays natively and wrap them as ByteBuffers,
            // which is much faster and more efficient than a list of wrappped
            // Byte/Integer objects
            case "SInt8":
            case "UInt8":
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeField

    public TypeField get(int classID, UnityVersion revision) {
        return get(classID, revision, true);
    }

    public TypeField get(int classID, UnityVersion version, boolean strict) {
        TypeField fieldNode = get(new ImmutablePair<>(classID, version));

        // if set to strict, only return exact matches or null
        if (fieldNode != null || strict) {
            return fieldNode;
        }

        TypeField fieldNodeB = null;
        UnityVersion versionB = null;

        TypeField fieldNodeC = null;
        UnityVersion versionC = null;

        for (Map.Entry<Pair<Integer, UnityVersion>, TypeField> entry : entrySet()) {
            Pair<Integer, UnityVersion> fieldNodeKey = entry.getKey();
            if (fieldNodeKey.getLeft() == classID) {
                TypeField fieldNodeEntry = entry.getValue();
                UnityVersion revisionEntry = fieldNodeKey.getRight();

                if (revisionEntry.getMajor() == version.getMajor()) {
                    if (revisionEntry.getMinor() == version.getMinor()) {
                        // if major and minor versions match, it will probably work
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeField

            // read field node table
            int fieldNodeSize = in.readInt();
            List<TypeField> fieldNodes = new ArrayList<>(fieldNodeSize);

            for (int i = 0; i < fieldNodeSize; i++) {
                TypeField fieldNode = new TypeField();
                fieldNode.read(in);
                fieldNodes.add(fieldNode);
            }

            // read version string table
            int versionSize = in.readInt();
            List<UnityVersion> versions = new ArrayList<>(versionSize);

            for (int i = 0; i < versionSize; i++) {
                versions.add(new UnityVersion(in.readStringNull()));
            }

            // read mapping data
            int fieldNodeKeySize = in.readInt();

            for (int i = 0; i < fieldNodeKeySize; i++) {
                int index = in.readInt();
                int classID = in.readInt();
                int revisionIndex = in.readInt();
               
                UnityVersion version = versions.get(revisionIndex);
                TypeField fieldNode = fieldNodes.get(index);

                ftm.add(classID, version, fieldNode);
            }
        } catch (IOException ex) {
            L.log(Level.SEVERE, "Can't read struct database", ex);
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeField

            L.warning("Revision = null");
            return;
        }
       
        for (Integer classID : classIDs) {
            TypeField ft = ftm.get(classID, typeTree.getEngineVersion(), false);
            if (ft != null) {
                typeTree.getFields().put(classID, ft);
            }
        }
    }
View Full Code Here

Examples of info.ata4.unity.asset.struct.TypeField

       
        int learnedNew = 0;
       
        // merge the TypeTree map with the database field map
        for (Integer classID : classIDs) {
            TypeField fieldType = typeTree.getFields().get(classID);
            String fieldClassName = ClassID.getNameForID(classID);

            if (fieldType == null) {
                continue;
            }
           
            TypeField fieldTypeMapped = ftm.get(classID, typeTree.getEngineVersion());

            if (fieldTypeMapped == null) {
                fieldTypeMapped = fieldType;
                L.log(Level.INFO, "New: {0} ({1})", new Object[]{classID, fieldClassName});
                ftm.add(classID, typeTree.getEngineVersion(), fieldTypeMapped);
                learnedNew++;
            }

            // check the hashes, they must be identical at this point
            int hash1 = fieldType.hashCode();
            int hash2 = fieldTypeMapped.hashCode();

            if (hash1 != hash2) {
                L.log(Level.WARNING, "Database hash mismatch for {0}: {1} != {2}", new Object[] {fieldTypeMapped.getType(), hash1, hash2});
            }

            if (fieldClassName == null) {
                L.log(Level.WARNING, "Unknown ClassID {0}, suggested name: {1}", new Object[] {classID, fieldType.getType()});
            }
View Full Code Here

Examples of org.kie.workbench.common.services.refactoring.model.index.TypeField

            //Add field
            final String fieldName = getFieldName( e.getKey() );
            final String fieldFullyQualifiedClassName = getFieldFullyQualifiedClassName( fullyQualifiedClassName,
                                                                                         fieldName );
            builder.addGenerator( new TypeField( new ValueFieldIndexTerm( fieldName ),
                                                 new ValueTypeIndexTerm( fieldFullyQualifiedClassName ),
                                                 new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
        }

        results.addAll( builder.build() );
View Full Code Here

Examples of org.kie.workbench.common.services.refactoring.model.index.TypeField

        //Add field
        final String fieldName = model.getFieldName();
        final String fieldFullyQualifiedClassName = getFieldFullyQualifiedClassName( fullyQualifiedClassName,
                                                                                     fieldName );
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( fieldName ),
                                             new ValueTypeIndexTerm( fieldFullyQualifiedClassName ),
                                             new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );

        //Add Characteristics
        for ( Characteristic c : model.getCharacteristics() ) {
View Full Code Here

Examples of org.kie.workbench.common.services.refactoring.model.index.TypeField

        //Add field
        final String fieldName = c.getField();
        final String fieldFullyQualifiedClassName = getFieldFullyQualifiedClassName( fullyQualifiedClassName,
                                                                                     fieldName );
        builder.addGenerator( new TypeField( new ValueFieldIndexTerm( fieldName ),
                                             new ValueTypeIndexTerm( fieldFullyQualifiedClassName ),
                                             new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.