use of org.terasology.persistence.typeHandling.PersistedDataMap in project Terasology by MovingBlocks.
the class Rect2fTypeHandler method deserialize.
@Override
public Rect2f deserialize(PersistedData data, DeserializationContext context) {
if (!data.isNull() && data.isValueMap()) {
PersistedDataMap map = data.getAsValueMap();
Vector2f min = context.deserializeAs(map.get(MIN_FIELD), Vector2f.class);
Vector2f size = context.deserializeAs(map.get(SIZE_FIELD), Vector2f.class);
return Rect2f.createFromMinAndSize(min, size);
}
return null;
}
use of org.terasology.persistence.typeHandling.PersistedDataMap in project Terasology by MovingBlocks.
the class Rect2iTypeHandler method deserialize.
@Override
public Rect2i deserialize(PersistedData data, DeserializationContext context) {
if (!data.isNull() && data.isValueMap()) {
PersistedDataMap map = data.getAsValueMap();
Vector2i min = context.deserializeAs(map.get(MIN_FIELD), Vector2i.class);
Vector2i size = context.deserializeAs(map.get(SIZE_FIELD), Vector2i.class);
return Rect2i.createFromMinAndSize(min, size);
}
return null;
}
use of org.terasology.persistence.typeHandling.PersistedDataMap in project Terasology by MovingBlocks.
the class Region3iTypeHandler method deserialize.
@Override
public Region3i deserialize(PersistedData data, DeserializationContext context) {
if (!data.isNull() && data.isValueMap()) {
PersistedDataMap map = data.getAsValueMap();
Vector3i min = context.deserializeAs(map.get(MIN_FIELD), Vector3i.class);
Vector3i size = context.deserializeAs(map.get(SIZE_FIELD), Vector3i.class);
return Region3i.createFromMinAndSize(min, size);
}
return null;
}
Aggregations