avocado-old/packages/behavior/item/literal.js

31 lines
360 B
JavaScript
Raw Normal View History

2019-03-17 23:45:48 -05:00
export class Literal {
static type() {
return 'literal';
}
constructor() {
this.value = null;
}
fromJSON(json) {
this.value = json.value;
return this;
}
get(context) {
return this.value;
}
set(value) {
this.value = value;
}
toJSON() {
return {
type: 'literal',
value: this.value,
}
}
}