This commit is contained in:
Jeremiah Billmann
2013-07-06 14:21:11 -04:00
parent a366576031
commit 8290aa31fa
6 changed files with 42 additions and 7 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
exports = module.exports = Entity;
function Entity (id) {
this.state;
this.state = {};
this.sequence = 1;
this.id = id;
this.stateHistory = [];
@@ -10,6 +10,7 @@ function Entity (id) {
Entity.prototype = {
addState: function (state, executionTime) {
var minTime, spliceTo = 0;
this.state = state;
this.stateHistory.push({ state: state, executionTime: executionTime });
minTime = this.stateHistory[this.stateHistory.length - 1].executionTime - 1000;