mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
29 lines
No EOL
831 B
JavaScript
29 lines
No EOL
831 B
JavaScript
define(["Chuck/Processors/ServerProcessor"], function(ServerProcessor) {
|
|
|
|
function ServerGame(channel) {
|
|
this.channel = channel;
|
|
this.serverProcessor = 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.updateClientsWorld = function(update_world) {
|
|
this.channel.sendCommandToAllUsers('gameCommand', {worldUpdate: update_world});
|
|
}
|
|
|
|
return ServerGame;
|
|
}); |