Differential D972 Diff 6041 ps/trunk/binaries/data/mods/public/simulation/components/PlayerManager.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/PlayerManager.js
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
PlayerManager.prototype.GetAllPlayers = function() | PlayerManager.prototype.GetAllPlayers = function() | ||||
{ | { | ||||
let players = []; | let players = []; | ||||
for (let i = 0; i < this.playerEntities.length; ++i) | for (let i = 0; i < this.playerEntities.length; ++i) | ||||
players.push(i); | players.push(i); | ||||
return players; | return players; | ||||
}; | }; | ||||
/** | |||||
* Returns IDs of all players excluding gaia. | |||||
*/ | |||||
PlayerManager.prototype.GetNonGaiaPlayers = function() | |||||
{ | |||||
let players = []; | |||||
for (let i = 1; i < this.playerEntities.length; ++i) | |||||
players.push(i); | |||||
return players; | |||||
}; | |||||
PlayerManager.prototype.RemoveAllPlayers = function() | PlayerManager.prototype.RemoveAllPlayers = function() | ||||
{ | { | ||||
// Destroy existing player entities | // Destroy existing player entities | ||||
for (var id of this.playerEntities) | for (var id of this.playerEntities) | ||||
Engine.DestroyEntity(id); | Engine.DestroyEntity(id); | ||||
this.playerEntities = []; | this.playerEntities = []; | ||||
}; | }; | ||||
Show All 11 Lines |
Wildfire Games · Phabricator