mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Moved id into base entity
This commit is contained in:
@@ -81,9 +81,9 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
function Entity() {
|
||||
function Entity(id) {
|
||||
this.updates = [];
|
||||
this.id;
|
||||
this.id = id;
|
||||
this.currentState = {};
|
||||
}
|
||||
Entity.prototype = {
|
||||
@@ -133,8 +133,7 @@ window.GarageServerIO = (function (window, socketio) {
|
||||
};
|
||||
|
||||
function Player(id) {
|
||||
Entity.call(this);
|
||||
this.id = id;
|
||||
Entity.call(this, id);
|
||||
}
|
||||
Player.prototype = Object.create(Entity.prototype);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
exports = module.exports = Entity;
|
||||
|
||||
function Entity () {
|
||||
function Entity (id) {
|
||||
this.state;
|
||||
this.sequence = 1;
|
||||
this.id;
|
||||
this.id = id;
|
||||
this.stateHistory = [];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@ var Entity = require('./entity');
|
||||
exports = module.exports = Player;
|
||||
|
||||
function Player (client) {
|
||||
Entity.call(this);
|
||||
Entity.call(this, client.id);
|
||||
this.client = client;
|
||||
this.id = client.id;
|
||||
this.inputs = [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user