Game
in package
Table of Contents
Constants
- GAME_TYPE_DEFAULT = 0
- GAME_TYPE_DRAFT = 5
- GAME_TYPE_FFA = 6
- GAME_TYPE_HUNTER_WARS = 3
- GAME_TYPE_NEWBIE = 7
- GAME_TYPE_SEMI_WARS = 4
- GAME_TYPES = [self::GAME_TYPE_DEFAULT => 'Default', self::GAME_TYPE_HUNTER_WARS => 'Hunter Wars', self::GAME_TYPE_SEMI_WARS => 'Semi Wars', self::GAME_TYPE_DRAFT => 'Draft', self::GAME_TYPE_FFA => 'FFA', self::GAME_TYPE_NEWBIE => 'Newbie']
Properties
- $allianceMaxPlayers : int
- $allianceMaxVets : int
- $CACHE_GAMES : array<int, self>
- $creditsNeeded : int
- $description : string
- $destroyPorts : bool
- $enabled : bool
- $endTime : int
- $gameID : int
- $gameSpeed : float
- $gameTypeID : int
- $hasChanged : bool
- $ignoreStats : bool
- $isNew : bool
- $joinTime : int
- $maxPlayers : int
- $maxTurns : int
- $name : string
- $playableRaceIDs : array<string|int, int>
- $startingCredits : int
- $startTime : int
- $startTurnHours : int
- $totalPlayers : int
Methods
- canDestroyPorts() : bool
- clearCache() : void
- createGame() : self
- equals() : bool
- gameExists() : bool
- Attempts to construct the game to determine if it exists.
- getAllianceMaxPlayers() : int
- getAllianceMaxVets() : int
- getCreditsNeeded() : int
- getDescription() : string
- getDisplayName() : string
- getEndTime() : int
- Returns the epoch time when the game ends.
- getGalaxies() : array<int, Galaxy>
- getGame() : self
- getGameID() : int
- getGameSpeed() : float
- getGameType() : string
- getJoinTime() : int
- Returns the epoch time when players can begin to join the game.
- getLastSectorID() : int
- getMaxPlayers() : int
- getMaxTurns() : int
- getName() : string
- getNumberOfGalaxies() : int
- getPlayableRaceIDs() : array<string|int, int>
- Get the list of playable Race IDs based on which Racial HQ's are locations in this game.
- getStartingCredits() : int
- getStartTime() : int
- Returns the epoch time when the game starts, i.e. when players can move, turns are gained, etc.
- getStartTurnHours() : int
- getTotalPlayers() : int
- hasEnded() : bool
- hasStarted() : bool
- isEnabled() : bool
- isGameType() : bool
- isIgnoreStats() : bool
- save() : void
- saveGames() : void
- setAllianceMaxPlayers() : void
- setAllianceMaxVets() : void
- setCreditsNeeded() : void
- setDescription() : void
- setDestroyPorts() : void
- setEnabled() : void
- setEndTime() : void
- setGameSpeed() : void
- setGameTypeID() : void
- setIgnoreStats() : void
- setJoinTime() : void
- setMaxPlayers() : void
- setMaxTurns() : void
- setName() : void
- setStartingCredits() : void
- setStartingRelations() : void
- Set the starting political relations between races.
- setStartTime() : void
- setStartTurnHours() : void
- timeUntilShipUnlock() : int
- Returns the time (in seconds) until restricted ships are unlocked.
- __construct() : mixed
Constants
GAME_TYPE_DEFAULT
public
mixed
GAME_TYPE_DEFAULT
= 0
GAME_TYPE_DRAFT
public
mixed
GAME_TYPE_DRAFT
= 5
GAME_TYPE_FFA
public
mixed
GAME_TYPE_FFA
= 6
GAME_TYPE_HUNTER_WARS
public
mixed
GAME_TYPE_HUNTER_WARS
= 3
GAME_TYPE_NEWBIE
public
mixed
GAME_TYPE_NEWBIE
= 7
GAME_TYPE_SEMI_WARS
public
mixed
GAME_TYPE_SEMI_WARS
= 4
GAME_TYPES
public
mixed
GAME_TYPES
= [self::GAME_TYPE_DEFAULT => 'Default', self::GAME_TYPE_HUNTER_WARS => 'Hunter Wars', self::GAME_TYPE_SEMI_WARS => 'Semi Wars', self::GAME_TYPE_DRAFT => 'Draft', self::GAME_TYPE_FFA => 'FFA', self::GAME_TYPE_NEWBIE => 'Newbie']
Properties
$allianceMaxPlayers
protected
int
$allianceMaxPlayers
$allianceMaxVets
protected
int
$allianceMaxVets
$CACHE_GAMES
protected
static array<int, self>
$CACHE_GAMES
= []
$creditsNeeded
protected
int
$creditsNeeded
$description
protected
string
$description
$destroyPorts
protected
bool
$destroyPorts
$enabled
protected
bool
$enabled
$endTime
protected
int
$endTime
$gameID read-only
protected
int
$gameID
$gameSpeed
protected
float
$gameSpeed
$gameTypeID
protected
int
$gameTypeID
$hasChanged
protected
bool
$hasChanged
= false
$ignoreStats
protected
bool
$ignoreStats
$isNew
protected
bool
$isNew
= false
$joinTime
protected
int
$joinTime
$maxPlayers
protected
int
$maxPlayers
$maxTurns
protected
int
$maxTurns
$name
protected
string
$name
$playableRaceIDs
protected
array<string|int, int>
$playableRaceIDs
$startingCredits
protected
int
$startingCredits
$startTime
protected
int
$startTime
$startTurnHours
protected
int
$startTurnHours
$totalPlayers
protected
int
$totalPlayers
Methods
canDestroyPorts()
public
canDestroyPorts() : bool
Return values
boolclearCache()
public
static clearCache() : void
createGame()
public
static createGame(int $gameID) : self
Parameters
- $gameID : int
Return values
selfequals()
public
equals(self $otherGame) : bool
Parameters
- $otherGame : self
Return values
boolgameExists()
Attempts to construct the game to determine if it exists.
public
static gameExists(int $gameID) : bool
Parameters
- $gameID : int
Return values
boolgetAllianceMaxPlayers()
public
getAllianceMaxPlayers() : int
Return values
intgetAllianceMaxVets()
public
getAllianceMaxVets() : int
Return values
intgetCreditsNeeded()
public
getCreditsNeeded() : int
Return values
intgetDescription()
public
getDescription() : string
Return values
stringgetDisplayName()
public
getDisplayName() : string
Return values
stringgetEndTime()
Returns the epoch time when the game ends.
public
getEndTime() : int
Return values
intgetGalaxies()
public
getGalaxies() : array<int, Galaxy>
Return values
array<int, Galaxy>getGame()
public
static getGame(int $gameID[, bool $forceUpdate = false ]) : self
Parameters
- $gameID : int
- $forceUpdate : bool = false
Return values
selfgetGameID()
public
getGameID() : int
Return values
intgetGameSpeed()
public
getGameSpeed() : float
Return values
floatgetGameType()
public
getGameType() : string
Return values
stringgetJoinTime()
Returns the epoch time when players can begin to join the game.
public
getJoinTime() : int
Return values
intgetLastSectorID()
public
getLastSectorID() : int
Return values
intgetMaxPlayers()
public
getMaxPlayers() : int
Return values
intgetMaxTurns()
public
getMaxTurns() : int
Return values
intgetName()
public
getName() : string
Return values
stringgetNumberOfGalaxies()
public
getNumberOfGalaxies() : int
Return values
intgetPlayableRaceIDs()
Get the list of playable Race IDs based on which Racial HQ's are locations in this game.
public
getPlayableRaceIDs() : array<string|int, int>
Return values
array<string|int, int>getStartingCredits()
public
getStartingCredits() : int
Return values
intgetStartTime()
Returns the epoch time when the game starts, i.e. when players can move, turns are gained, etc.
public
getStartTime() : int
Return values
intgetStartTurnHours()
public
getStartTurnHours() : int
Return values
intgetTotalPlayers()
public
getTotalPlayers() : int
Return values
inthasEnded()
public
hasEnded() : bool
Return values
boolhasStarted()
public
hasStarted() : bool
Return values
boolisEnabled()
public
isEnabled() : bool
Return values
boolisGameType()
public
isGameType(int $gameTypeID) : bool
Parameters
- $gameTypeID : int
Return values
boolisIgnoreStats()
public
isIgnoreStats() : bool
Return values
boolsave()
public
save() : void
saveGames()
public
static saveGames() : void
setAllianceMaxPlayers()
public
setAllianceMaxPlayers(int $int) : void
Parameters
- $int : int
setAllianceMaxVets()
public
setAllianceMaxVets(int $int) : void
Parameters
- $int : int
setCreditsNeeded()
public
setCreditsNeeded(int $creditsNeeded) : void
Parameters
- $creditsNeeded : int
setDescription()
public
setDescription(string $description) : void
Parameters
- $description : string
setDestroyPorts()
public
setDestroyPorts(bool $destroyPorts) : void
Parameters
- $destroyPorts : bool
setEnabled()
public
setEnabled(bool $bool) : void
Parameters
- $bool : bool
setEndTime()
public
setEndTime(int $endTime) : void
Parameters
- $endTime : int
setGameSpeed()
public
setGameSpeed(float $gameSpeed) : void
Parameters
- $gameSpeed : float
setGameTypeID()
public
setGameTypeID(int $gameTypeID) : void
Parameters
- $gameTypeID : int
setIgnoreStats()
public
setIgnoreStats(bool $bool) : void
Parameters
- $bool : bool
setJoinTime()
public
setJoinTime(int $joinTime) : void
Parameters
- $joinTime : int
setMaxPlayers()
public
setMaxPlayers(int $maxPlayers) : void
Parameters
- $maxPlayers : int
setMaxTurns()
public
setMaxTurns(int $int) : void
Parameters
- $int : int
setName()
public
setName(string $name) : void
Parameters
- $name : string
setStartingCredits()
public
setStartingCredits(int $int) : void
Parameters
- $int : int
setStartingRelations()
Set the starting political relations between races.
public
setStartingRelations(int $relations) : void
Parameters
- $relations : int
setStartTime()
public
setStartTime(int $startTime) : void
Parameters
- $startTime : int
setStartTurnHours()
public
setStartTurnHours(int $int) : void
Parameters
- $int : int
timeUntilShipUnlock()
Returns the time (in seconds) until restricted ships are unlocked.
public
timeUntilShipUnlock() : int
Return values
int__construct()
protected
__construct(int $gameID[, bool $create = false ]) : mixed
Parameters
- $gameID : int
- $create : bool = false