replaced all tabs with 4 spaces

This commit is contained in:
logsol 2012-07-28 13:26:05 +02:00
parent 5d11540c55
commit 26f3d22db7
30 changed files with 1017 additions and 1011 deletions

38
app/Game/Core/Protocol/Helper.js Normal file → Executable file
View file

@ -1,29 +1,29 @@
define([
"Game/Core/Protocol/Parser"
"Game/Core/Protocol/Parser"
],
function(Parser) {
var Helper = {}
var Helper = {}
Helper.encodeCommand = function(command, options){
return Parser.encode(Helper.assemble(command, options));
}
Helper.encodeCommand = function(command, options){
return Parser.encode(Helper.assemble(command, options));
}
Helper.assemble = function(command, options){
var commands = {};
commands[command] = options || null;
return commands;
}
Helper.assemble = function(command, options){
var commands = {};
commands[command] = options || null;
return commands;
}
Helper.runCommands = function(message, callback){
var commands = Parser.decode(message);
for(var command in commands) {
callback(command, commands[command]);
}
}
Helper.runCommands = function(message, callback){
var commands = Parser.decode(message);
for(var command in commands) {
callback(command, commands[command]);
}
}
return Helper;
return Helper;
});

16
app/Game/Core/Protocol/Parser.js Normal file → Executable file
View file

@ -3,15 +3,15 @@ define([
function() {
var Parser = {};
var Parser = {};
Parser.encode = function(message){
return JSON.stringify(message);
}
Parser.encode = function(message){
return JSON.stringify(message);
}
Parser.decode = function(message){
return JSON.parse(message);
}
Parser.decode = function(message){
return JSON.parse(message);
}
return Parser;
return Parser;
});