mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-08-18 11:40:30 +08:00
Progress #3
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user