Package org.terasology.persistence.typeHandling

Examples of org.terasology.persistence.typeHandling.Serializer.serializeValue()


            if (check.shouldSerializeField(field, delta)) {
                Object origValue = field.getValue(base);
                Object deltaValue = field.getValue(delta);

                if (!Objects.equal(origValue, deltaValue)) {
                    PersistedData value = serializer.serializeValue(field, deltaValue, serializationContext);
                    if (!value.isNull()) {
                        EntityData.Value dataValue = ((ProtobufPersistedData) value).getValue();
                        if (usingFieldIds) {
                            componentMessage.addField(EntityData.NameValue.newBuilder().setNameIndex(field.getId()).setValue(dataValue).build());
                        } else {
View Full Code Here


        for (ReplicatedFieldMetadata field : componentMetadata.getFields()) {
            if (fieldCheck.shouldSerializeField(field, newComponent, componentInitial)) {
                Object oldValue = field.getValue(oldComponent);
                Object newValue = field.getValue(newComponent);
                if (!Objects.equal(oldValue, newValue)) {
                    PersistedData data = serializer.serializeValue(field, newValue, serializationContext);
                    if (!data.isNull()) {
                        entityFieldIds.write(field.getId());
                        entityData.addFieldValue(((ProtobufPersistedData) data).getValue());
                        fieldCount++;
                    } else {
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.