avocado-old/packages/behavior/item/routine.js
2019-09-08 08:18:16 -05:00

34 lines
481 B
JavaScript

import {Actions} from './actions';
export class Routine {
static type() {
return 'routine';
}
constructor() {
this.actions = new Actions();
}
clone(other) {
this.actions = other.actions.clone();
}
fromJSON(json) {
this.actions.fromJSON(json.routine);
return this;
}
tick(context, elapsed) {
this.actions.tick(context, elapsed);
}
toJSON() {
return {
type: 'routine',
actions: this.actions.toJSON(),
}
}
}