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
|
|
@ -1,5 +1,6 @@
|
|||
define([
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Doll",
|
||||
"Game/" + GLOBALS.context + "/Control/PlayerController",
|
||||
"Game/Config/Settings",
|
||||
"Lib/Utilities/NotificationCenter",
|
||||
"Lib/Utilities/Exception",
|
||||
|
|
@ -8,7 +9,7 @@ define([
|
|||
"Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll"
|
||||
],
|
||||
|
||||
function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) {
|
||||
function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll
|
|||
|
||||
this.user = user;
|
||||
this.physicsEngine = physicsEngine;
|
||||
this.playerController = null;
|
||||
this.playerController = null; // pre-initialise with null, because client/players don't get one
|
||||
this.doll;
|
||||
this.id = id;
|
||||
this.spawned = false;
|
||||
|
|
@ -183,13 +184,9 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll
|
|||
}
|
||||
}
|
||||
|
||||
Player.prototype.setPlayerController = function(playerController) {
|
||||
this.playerController = playerController;
|
||||
}
|
||||
|
||||
Player.prototype.getPlayerController = function() {
|
||||
return this.playerController;
|
||||
}
|
||||
Player.prototype.setInBetweenRounds = function(inBetweenRounds) {
|
||||
return this.playerController.setInBetweenRounds(inBetweenRounds);
|
||||
};
|
||||
|
||||
return Player;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue