Files
agent/config-serializer/config-items/Layer.ts
2016-08-28 00:59:19 +02:00

36 lines
833 B
TypeScript

import { Serializable } from '../Serializable';
import { Modules } from './Modules';
import { UhkBuffer } from '../UhkBuffer';
import { AnimationKeyboard } from '../../src/components/svg/wrap';
export class Layer extends Serializable<Layer> {
modules: Modules;
animation: AnimationKeyboard = 'none';
_fromJsObject(jsObject: any): Layer {
this.modules = new Modules().fromJsObject(jsObject.modules);
return this;
}
_fromBinary(buffer: UhkBuffer): Layer {
this.modules = new Modules().fromBinary(buffer);
return this;
}
_toJsObject(): any {
return {
modules: this.modules.toJsObject()
};
}
_toBinary(buffer: UhkBuffer): void {
this.modules.toBinary(buffer);
}
toString(): string {
return `<Layer>`;
}
}