mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-25 00:51:10 +08:00
Serialization work in progress
This commit is contained in:
15
js/serialization/SerializerFactory.js
Normal file
15
js/serialization/SerializerFactory.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import ObjectEntity from "../entity/ObjectEntity";
|
||||
import PinEntity from "../entity/PinEntity";
|
||||
import SerializeObject from "./ObjectSerialize";
|
||||
import PinSerializer from "./PinSerializer";
|
||||
|
||||
export default class SerializerFactory {
|
||||
static serializers = new Map([
|
||||
[PinEntity.prototype.constructor.name, PinSerializer],
|
||||
[ObjectEntity.prototype.constructor.name, SerializeObject]
|
||||
])
|
||||
|
||||
createSerializer(object) {
|
||||
return SerializerFactory.serializers.get(object.constructor.name)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user