From 9de3147406686f7888d15261095793a8ba6c62ca Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 21 Jul 2012 21:20:29 +0200 Subject: [PATCH] moved files towards new structure. fixes #22 --- {lib/Server => app/bootstrap}/HttpServer.js | 0 {lib/Server => app/bootstrap}/Socket.js | 0 client.js => app/bootstrap/client.js | 0 server.js => app/bootstrap/server.js | 0 .../game/Client}/Collision/Detector.js | 0 {lib/Chuck => app/game/Client}/Control/Key.js | 0 .../game/Client/Control/KeyboardController.js | 0 .../game/Client}/Control/KeyboardInput.js | 0 .../game/Client/GameController.js | 0 {lib => app/game}/Client/Networker.js | 0 .../game/Client}/View/CameraController.js | 0 .../game/Client/View/DomController.js | 0 .../game/Client}/View/ViewController.js | 0 {lib/Chuck => app/game/Config}/Settings.js | 0 app/game/Core/Collision/Detector.js | 0 .../game/Core}/Control/InputController.js | 0 app/game/Core/GameController.js | 0 {lib/Chuck => app/game/Core}/Loader/Level.js | 0 {lib/Chuck => app/game/Core}/Physics/Doll.js | 0 .../Chuck => app/game/Core}/Physics/Engine.js | 0 {lib/Chuck => app/game/Core}/Player.js | 0 {lib => app/game/Core}/Protocol/Helper.js | 0 {lib => app/game/Core}/Protocol/Parser.js | 0 {lib => app/game}/Server/Channel.js | 0 app/game/Server/Collision/Detector.js | 0 .../game/Server/GameController.js | 0 .../game}/Server/NotificationCenter.js | 0 {lib => app/game}/Server/User.js | 0 {lib/Vendor => app/lib}/Box2D.js | 0 {lib/Vendor => app/lib}/SocketIO.js | 0 {lib/Vendor => app/lib}/Three.js | 0 {lib/Vendor => app/lib}/Three/Three.js | 0 .../lib/Utilities/RequestAnimFrame.js | 0 {lib/Server => app/lobby}/Coordinator.js | 0 lib/Chuck/ClientGame.js | 38 ------------------ lib/Chuck/Constants.js | 9 ----- lib/Chuck/Server.js | 1 - lib/Chuck/ServerGame.js | 33 --------------- lib/Server/Factory.js | 29 ------------- lib/Vendor/.DS_Store | Bin 6148 -> 0 bytes 40 files changed, 110 deletions(-) rename {lib/Server => app/bootstrap}/HttpServer.js (100%) rename {lib/Server => app/bootstrap}/Socket.js (100%) rename client.js => app/bootstrap/client.js (100%) rename server.js => app/bootstrap/server.js (100%) rename {lib/Chuck => app/game/Client}/Collision/Detector.js (100%) rename {lib/Chuck => app/game/Client}/Control/Key.js (100%) rename lib/Chuck/Control/InputControlUnit.js => app/game/Client/Control/KeyboardController.js (100%) rename {lib/Chuck => app/game/Client}/Control/KeyboardInput.js (100%) rename lib/Chuck/Processors/ClientProcessor.js => app/game/Client/GameController.js (100%) rename {lib => app/game}/Client/Networker.js (100%) rename {lib/Chuck => app/game/Client}/View/CameraController.js (100%) rename lib/Client/Dom.js => app/game/Client/View/DomController.js (100%) rename {lib/Chuck => app/game/Client}/View/ViewController.js (100%) rename {lib/Chuck => app/game/Config}/Settings.js (100%) create mode 100644 app/game/Core/Collision/Detector.js rename {lib/Chuck => app/game/Core}/Control/InputController.js (100%) create mode 100644 app/game/Core/GameController.js rename {lib/Chuck => app/game/Core}/Loader/Level.js (100%) rename {lib/Chuck => app/game/Core}/Physics/Doll.js (100%) rename {lib/Chuck => app/game/Core}/Physics/Engine.js (100%) rename {lib/Chuck => app/game/Core}/Player.js (100%) rename {lib => app/game/Core}/Protocol/Helper.js (100%) rename {lib => app/game/Core}/Protocol/Parser.js (100%) rename {lib => app/game}/Server/Channel.js (100%) create mode 100644 app/game/Server/Collision/Detector.js rename lib/Chuck/Processors/ServerProcessor.js => app/game/Server/GameController.js (100%) rename {lib => app/game}/Server/NotificationCenter.js (100%) rename {lib => app/game}/Server/User.js (100%) rename {lib/Vendor => app/lib}/Box2D.js (100%) rename {lib/Vendor => app/lib}/SocketIO.js (100%) rename {lib/Vendor => app/lib}/Three.js (100%) rename {lib/Vendor => app/lib}/Three/Three.js (100%) rename lib/RequestAnimationFrame.js => app/lib/Utilities/RequestAnimFrame.js (100%) rename {lib/Server => app/lobby}/Coordinator.js (100%) delete mode 100644 lib/Chuck/ClientGame.js delete mode 100644 lib/Chuck/Constants.js delete mode 100644 lib/Chuck/Server.js delete mode 100644 lib/Chuck/ServerGame.js delete mode 100644 lib/Server/Factory.js delete mode 100644 lib/Vendor/.DS_Store diff --git a/lib/Server/HttpServer.js b/app/bootstrap/HttpServer.js similarity index 100% rename from lib/Server/HttpServer.js rename to app/bootstrap/HttpServer.js diff --git a/lib/Server/Socket.js b/app/bootstrap/Socket.js similarity index 100% rename from lib/Server/Socket.js rename to app/bootstrap/Socket.js diff --git a/client.js b/app/bootstrap/client.js similarity index 100% rename from client.js rename to app/bootstrap/client.js diff --git a/server.js b/app/bootstrap/server.js similarity index 100% rename from server.js rename to app/bootstrap/server.js diff --git a/lib/Chuck/Collision/Detector.js b/app/game/Client/Collision/Detector.js similarity index 100% rename from lib/Chuck/Collision/Detector.js rename to app/game/Client/Collision/Detector.js diff --git a/lib/Chuck/Control/Key.js b/app/game/Client/Control/Key.js similarity index 100% rename from lib/Chuck/Control/Key.js rename to app/game/Client/Control/Key.js diff --git a/lib/Chuck/Control/InputControlUnit.js b/app/game/Client/Control/KeyboardController.js similarity index 100% rename from lib/Chuck/Control/InputControlUnit.js rename to app/game/Client/Control/KeyboardController.js diff --git a/lib/Chuck/Control/KeyboardInput.js b/app/game/Client/Control/KeyboardInput.js similarity index 100% rename from lib/Chuck/Control/KeyboardInput.js rename to app/game/Client/Control/KeyboardInput.js diff --git a/lib/Chuck/Processors/ClientProcessor.js b/app/game/Client/GameController.js similarity index 100% rename from lib/Chuck/Processors/ClientProcessor.js rename to app/game/Client/GameController.js diff --git a/lib/Client/Networker.js b/app/game/Client/Networker.js similarity index 100% rename from lib/Client/Networker.js rename to app/game/Client/Networker.js diff --git a/lib/Chuck/View/CameraController.js b/app/game/Client/View/CameraController.js similarity index 100% rename from lib/Chuck/View/CameraController.js rename to app/game/Client/View/CameraController.js diff --git a/lib/Client/Dom.js b/app/game/Client/View/DomController.js similarity index 100% rename from lib/Client/Dom.js rename to app/game/Client/View/DomController.js diff --git a/lib/Chuck/View/ViewController.js b/app/game/Client/View/ViewController.js similarity index 100% rename from lib/Chuck/View/ViewController.js rename to app/game/Client/View/ViewController.js diff --git a/lib/Chuck/Settings.js b/app/game/Config/Settings.js similarity index 100% rename from lib/Chuck/Settings.js rename to app/game/Config/Settings.js diff --git a/app/game/Core/Collision/Detector.js b/app/game/Core/Collision/Detector.js new file mode 100644 index 0000000..e69de29 diff --git a/lib/Chuck/Control/InputController.js b/app/game/Core/Control/InputController.js similarity index 100% rename from lib/Chuck/Control/InputController.js rename to app/game/Core/Control/InputController.js diff --git a/app/game/Core/GameController.js b/app/game/Core/GameController.js new file mode 100644 index 0000000..e69de29 diff --git a/lib/Chuck/Loader/Level.js b/app/game/Core/Loader/Level.js similarity index 100% rename from lib/Chuck/Loader/Level.js rename to app/game/Core/Loader/Level.js diff --git a/lib/Chuck/Physics/Doll.js b/app/game/Core/Physics/Doll.js similarity index 100% rename from lib/Chuck/Physics/Doll.js rename to app/game/Core/Physics/Doll.js diff --git a/lib/Chuck/Physics/Engine.js b/app/game/Core/Physics/Engine.js similarity index 100% rename from lib/Chuck/Physics/Engine.js rename to app/game/Core/Physics/Engine.js diff --git a/lib/Chuck/Player.js b/app/game/Core/Player.js similarity index 100% rename from lib/Chuck/Player.js rename to app/game/Core/Player.js diff --git a/lib/Protocol/Helper.js b/app/game/Core/Protocol/Helper.js similarity index 100% rename from lib/Protocol/Helper.js rename to app/game/Core/Protocol/Helper.js diff --git a/lib/Protocol/Parser.js b/app/game/Core/Protocol/Parser.js similarity index 100% rename from lib/Protocol/Parser.js rename to app/game/Core/Protocol/Parser.js diff --git a/lib/Server/Channel.js b/app/game/Server/Channel.js similarity index 100% rename from lib/Server/Channel.js rename to app/game/Server/Channel.js diff --git a/app/game/Server/Collision/Detector.js b/app/game/Server/Collision/Detector.js new file mode 100644 index 0000000..e69de29 diff --git a/lib/Chuck/Processors/ServerProcessor.js b/app/game/Server/GameController.js similarity index 100% rename from lib/Chuck/Processors/ServerProcessor.js rename to app/game/Server/GameController.js diff --git a/lib/Server/NotificationCenter.js b/app/game/Server/NotificationCenter.js similarity index 100% rename from lib/Server/NotificationCenter.js rename to app/game/Server/NotificationCenter.js diff --git a/lib/Server/User.js b/app/game/Server/User.js similarity index 100% rename from lib/Server/User.js rename to app/game/Server/User.js diff --git a/lib/Vendor/Box2D.js b/app/lib/Box2D.js similarity index 100% rename from lib/Vendor/Box2D.js rename to app/lib/Box2D.js diff --git a/lib/Vendor/SocketIO.js b/app/lib/SocketIO.js similarity index 100% rename from lib/Vendor/SocketIO.js rename to app/lib/SocketIO.js diff --git a/lib/Vendor/Three.js b/app/lib/Three.js similarity index 100% rename from lib/Vendor/Three.js rename to app/lib/Three.js diff --git a/lib/Vendor/Three/Three.js b/app/lib/Three/Three.js similarity index 100% rename from lib/Vendor/Three/Three.js rename to app/lib/Three/Three.js diff --git a/lib/RequestAnimationFrame.js b/app/lib/Utilities/RequestAnimFrame.js similarity index 100% rename from lib/RequestAnimationFrame.js rename to app/lib/Utilities/RequestAnimFrame.js diff --git a/lib/Server/Coordinator.js b/app/lobby/Coordinator.js similarity index 100% rename from lib/Server/Coordinator.js rename to app/lobby/Coordinator.js diff --git a/lib/Chuck/ClientGame.js b/lib/Chuck/ClientGame.js deleted file mode 100644 index 91c0f16..0000000 --- a/lib/Chuck/ClientGame.js +++ /dev/null @@ -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; -}); \ No newline at end of file diff --git a/lib/Chuck/Constants.js b/lib/Chuck/Constants.js deleted file mode 100644 index f10054f..0000000 --- a/lib/Chuck/Constants.js +++ /dev/null @@ -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' -}); \ No newline at end of file diff --git a/lib/Chuck/Server.js b/lib/Chuck/Server.js deleted file mode 100644 index 9306fdb..0000000 --- a/lib/Chuck/Server.js +++ /dev/null @@ -1 +0,0 @@ -Server.js \ No newline at end of file diff --git a/lib/Chuck/ServerGame.js b/lib/Chuck/ServerGame.js deleted file mode 100644 index f57ab65..0000000 --- a/lib/Chuck/ServerGame.js +++ /dev/null @@ -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; -}); \ No newline at end of file diff --git a/lib/Server/Factory.js b/lib/Server/Factory.js deleted file mode 100644 index 36ebc84..0000000 --- a/lib/Server/Factory.js +++ /dev/null @@ -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; - -}); \ No newline at end of file diff --git a/lib/Vendor/.DS_Store b/lib/Vendor/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0