Package org.terasology.persistence.typeHandling.protobuf

Examples of org.terasology.persistence.typeHandling.protobuf.ProtobufPersistedData


                fieldInfo = componentMetadata.getField(field.getNameIndex());
            } else if (field.hasName()) {
                fieldInfo = componentMetadata.getField(field.getName());
            }
            if (fieldInfo != null) {
                dataMap.put(fieldInfo, new ProtobufPersistedData(field.getValue()));
            } else if (field.hasNameIndex()) {
                logger.warn("Cannot deserialize unknown field '{}' onto '{}'", field.getName(), componentMetadata.getUri());
            }
        }
        serializer.deserializeOnto(targetComponent, dataMap, context, fieldCheck);
View Full Code Here


            if (fieldInfo == null) {
                logger.error("Unable to serialize field {}, out of bounds", fieldId);
                continue;
            }
            if (fieldInfo.isReplicated()) {
                serializer.deserializeOnto(targetEvent, fieldInfo, new ProtobufPersistedData(eventData.getFieldValue(i)), deserializationContext);
            }
        }
        return targetEvent;
    }
View Full Code Here

            for (int fieldIndex = 0; fieldIndex < UnsignedBytes.toInt(entityData.getComponentFieldCounts().byteAt(componentIndex)); ++fieldIndex) {
                byte fieldId = entityData.getFieldIds().byteAt(fieldPos);
                ReplicatedFieldMetadata fieldMetadata = metadata.getField(fieldId);
                if (fieldMetadata != null && fieldCheck.shouldDeserialize(metadata, fieldMetadata)) {
                    logger.trace("Deserializing field {} of component {} as value {}", fieldMetadata, metadata, entityData.getFieldValue(fieldPos));
                    serializer.deserializeOnto(component, fieldMetadata, new ProtobufPersistedData(entityData.getFieldValue(fieldPos)), deserializationContext);
                }
                fieldPos++;
            }
            if (createdNewComponent) {
                entity.addComponent(component);
View Full Code Here

TOP

Related Classes of org.terasology.persistence.typeHandling.protobuf.ProtobufPersistedData

Copyright © 2018 www.massapicom. 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.