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

30 lines
436 B
JavaScript
Raw Normal View History

2019-03-17 23:45:48 -05:00
import {Actions} from './actions';
export class Routine {
constructor() {
this.actions = new Actions();
}
2019-04-25 00:48:53 -05:00
clone(other) {
this.actions = other.actions.clone();
}
2019-03-17 23:45:48 -05:00
fromJSON(json) {
2019-04-19 15:39:28 -05:00
this.actions.fromJSON(json.routine);
2019-03-17 23:45:48 -05:00
return this;
}
2019-09-08 08:18:16 -05:00
tick(context, elapsed) {
this.actions.tick(context, elapsed);
2019-03-17 23:45:48 -05:00
}
toJSON() {
return {
type: 'routine',
actions: this.actions.toJSON(),
}
}
}