moved files towards new structure. fixes #22

This commit is contained in:
logsol 2012-07-21 21:20:29 +02:00
parent 8cf8f057bb
commit 9de3147406
40 changed files with 0 additions and 110 deletions

View file

View file

View file

View file

@ -1,38 +0,0 @@
define(["Chuck/Processors/ClientProcessor"], function(ClientProcessor) {
function ClientGame(networker, id) {
this.networker = networker;
this.clientProcessor = new ClientProcessor(this);
this.clientProcessor.spawnMeWithId(id);
this.players = {};
}
ClientGame.prototype.loadLevel = function(path) {
this.clientProcessor.loadLevel(path);
}
ClientGame.prototype.userJoined = function(userId) {
this.players[userId] = this.clientProcessor.spawnNewPlayerWithId(userId);
}
ClientGame.prototype.userLeft = function(userId) {
var player = this.players[userId];
player.destroy();
delete this.players[userId];
}
ClientGame.prototype.processGameCommand = function(command, options){
this.clientProcessor.processGameCommand(command, options);
}
ClientGame.prototype.sendGameCommand = function(command, options) {
this.networker.sendGameCommand(command, options);
}
ClientGame.prototype.destruct = function(){
this.clientProcessor.destruct();
}
return ClientGame;
});

View file

@ -1,9 +0,0 @@
define({
COLLISION_IDENTIFIER_PLAYER: 'player',
COLLISION_IDENTIFIER_PLAYER_HEAD: 'head',
COLLISION_IDENTIFIER_PLAYER_CHEST: 'chest',
COLLISION_IDENTIFIER_PLAYER_LEGS: 'legs',
COLLISION_IDENTIFIER_PLAYER_FOOT_SENSOR: 'footsensor',
COLLISION_IDENTIFIER_TILE: 'tile'
});

View file

@ -1 +0,0 @@
Server.js

View file

@ -1,33 +0,0 @@
define(["Chuck/Processors/ServerProcessor"], function(ServerProcessor) {
function ServerGame(channel) {
this.channel = channel;
this.serverProcessor = this.factory.new(ServerProcessor, this);
}
ServerGame.prototype.loadLevel = function(path) {
this.serverProcessor.loadLevel(path);
}
ServerGame.prototype.progressGameCommandFromUser = function(command, options, user) {
this.serverProcessor.progressGameCommandFromId(command, options, user.id);
}
ServerGame.prototype.destruct = function() {
this.serverProcessor.destruct();
}
ServerGame.prototype.createPlayerForUser = function(user) {
this.serverProcessor.createPlayerWithId(user.id);
}
ServerGame.prototype.userIdLeft = function(userId) {
this.serverProcessor.userIdLeft(userId);
};
ServerGame.prototype.updateClientsWorld = function(update_world) {
this.channel.sendCommandToAllUsers('gameCommand', {worldUpdate: update_world});
}
return ServerGame;
});

View file

@ -1,29 +0,0 @@
define(['Server/NotificationCenter'], function(NotificationCenter) {
function Factory() {
this.notificationCenter = new NotificationCenter();
}
Factory.prototype.new = function (constructor /*, arg1, arg2, ... */) {
if (arguments.length < 1)
throw 'Too fiew arguments';
if (typeof arguments[0] != 'function')
throw arguments[0] + ' is not a function';
var instance = Object.create(constructor.prototype, {
notificationCenter: {
value: this.notificationCenter
},
factory: {
value: this
}
});
constructor.apply(instance, Array.prototype.slice.call(arguments, 1));
return instance;
}
return Factory;
});

BIN
lib/Vendor/.DS_Store vendored

Binary file not shown.