mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Hides playercontroller within player
In order to not provide deep exposure to PlayerController, we refactored it so that it is not visible anymore outside Player. Also we renamed isInBetweenGames to inBetweenRounds. Moved creation of PlayerController from GameController(s) to The channel Player and client Me.
This commit is contained in:
parent
8d8a55cc8c
commit
fc7866f11e
7 changed files with 24 additions and 27 deletions
|
|
@ -2,7 +2,6 @@ define([
|
|||
"Game/Core/GameController",
|
||||
"Game/Channel/Physics/Engine",
|
||||
"Game/Config/Settings",
|
||||
"Game/Channel/Control/PlayerController",
|
||||
"Lib/Utilities/RequestAnimFrame",
|
||||
"Lib/Utilities/NotificationCenter",
|
||||
"Lib/Vendor/Box2D",
|
||||
|
|
@ -12,7 +11,7 @@ define([
|
|||
"Game/Channel/GameObjects/Items/RubeDoll"
|
||||
],
|
||||
|
||||
function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) {
|
||||
function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
@ -62,7 +61,6 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
|
||||
GameController.prototype.createPlayer = function(user) {
|
||||
var player = Parent.prototype.createPlayer.call(this, user);
|
||||
player.setPlayerController(new PlayerController(player))
|
||||
user.setPlayer(player);
|
||||
};
|
||||
|
||||
|
|
@ -219,7 +217,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
this.roundHasEnded = true;
|
||||
|
||||
for(var id in this.players) {
|
||||
this.players[id].getPlayerController().setIsInBetweenGames(true);
|
||||
this.players[id].setInBetweenRounds(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue