mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Progress #3
This commit is contained in:
@@ -130,15 +130,11 @@ var GarageServerIO = (function (socketio) {
|
||||
function EntityController() {
|
||||
this.entities = [];
|
||||
}
|
||||
|
||||
function PlayerController() {
|
||||
EntityController.call(this);
|
||||
}
|
||||
PlayerController.prototype = {
|
||||
EntityController.prototype = {
|
||||
add: function (id) {
|
||||
var player = new Player(id);
|
||||
this.entities.push(player);
|
||||
return player;
|
||||
var entity = new Entity(id);
|
||||
this.entities.push(entity);
|
||||
return entity;
|
||||
},
|
||||
remove: function (id) {
|
||||
for (var i = 0; i < this.entities.length; i ++) {
|
||||
@@ -150,6 +146,15 @@ var GarageServerIO = (function (socketio) {
|
||||
}
|
||||
};
|
||||
|
||||
function PlayerController() {
|
||||
EntityController.call(this);
|
||||
}
|
||||
PlayerController.prototype.add = function (id) {
|
||||
var player = new Player(id);
|
||||
this.entities.push(player);
|
||||
return player;
|
||||
};
|
||||
|
||||
var _io = socketio,
|
||||
_socket = null,
|
||||
_options = null,
|
||||
|
||||
Reference in New Issue
Block a user