mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
Splitted Client and Server Processors
This commit is contained in:
parent
ae53d40c60
commit
8f38c6dcc6
4 changed files with 74 additions and 35 deletions
|
|
@ -1,11 +1,23 @@
|
|||
define(["Chuck/Processor"], function(Processor){
|
||||
define(["Chuck/Settings", "Chuck/Processors/ServerProcessor", "Chuck/Processors/ClientProcessor"], function(Settings, ServerProcessor, ClientProcessor){
|
||||
|
||||
function Game(networker){
|
||||
this.networker = networker;
|
||||
this.processor = new Processor();
|
||||
this.processor = this.createProcessor();
|
||||
|
||||
this.processor.loadLevel("default.json");
|
||||
}
|
||||
|
||||
Game.prototype.createProcessor = function(){
|
||||
var processor;
|
||||
|
||||
if(Settings.IS_BROWSER_ENVIRONMENT){
|
||||
processor = new ClientProcessor();
|
||||
} else {
|
||||
processor = new ServerProcessor();
|
||||
}
|
||||
return processor;
|
||||
}
|
||||
|
||||
Game.prototype.processGameCommand = function(command, options){
|
||||
console.log('(not implemented) processGameCommand:', command, options);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue