Force
in package
Table of Contents
Constants
- LOWEST_MAX_EXPIRE_SCOUTS_ONLY = 432000
- MAX_CDS = 50
- MAX_MINES = 50
- MAX_SDS = 5
- REFRESH_ALL_TIME_PER_STACK = 1
- SQL = 'game_id = :game_id AND sector_id = :sector_id AND owner_id = :owner_id'
- TIME_PER_SCOUT_ONLY = 86400
- TIME_PERCENT_PER_COMBAT = 0.02
- TIME_PERCENT_PER_MINE = 0.02
- TIME_PERCENT_PER_SCOUT = 0.02
Properties
- $CACHE_FORCES : array<int, array<int, array<int, self>>>
- $CACHE_SECTOR_FORCES : array<int, array<int, array<int, self>>>
- $combatDrones : int
- $expire : int
- $gameID : int
- $hasChanged : bool
- $isNew : bool
- $mines : int
- $ownerID : int
- $scoutDrones : int
- $sectorID : int
- $SQLID : array{game_id: int, sector_id: int, owner_id: int}
- $TIDIED_UP : array<int, array<int, bool>>
Methods
- __sleep() : mixed
- addCDs() : void
- addMines() : void
- addSDs() : void
- clearCache() : void
- exists() : bool
- getAttackForcesHREF() : string
- getAttackTurnCost() : int
- getBumpTurnCost() : int
- getCDs() : int
- getDropCDHREF() : string
- getDropMineHREF() : string
- getDropSDHREF() : string
- getExamineDropForcesHREF() : string
- getExpire() : int
- getForce() : self
- getGalaxy() : Galaxy
- getGalaxyForces() : array<int, array<int, self>>
- getGameID() : int
- getMaxExpireTime() : int
- getMaxGalaxyExpireTime() : int
- getMines() : int
- getOwner() : AbstractPlayer
- getOwnerID() : int
- getRefreshAllHREF() : string
- getRefreshHREF() : string
- getSDs() : int
- getSector() : Sector
- getSectorForces() : array<int, self>
- getSectorID() : int
- getTakeCDHREF() : string
- getTakeMineHREF() : string
- getTakeSDHREF() : string
- hasCDs() : bool
- hasExpired() : bool
- hasMaxCDs() : bool
- hasMaxMines() : bool
- hasMaxSDs() : bool
- hasMines() : bool
- hasSDs() : bool
- killForcesByPlayer() : array{}
- ping() : void
- saveForces() : void
- setCDs() : void
- setExpire() : void
- setMines() : void
- setSDs() : void
- shootPlayers() : ForceCombatResults
- takeCDs() : void
- takeDamage() : ForceTakenDamageData
- takeMines() : void
- takeSDs() : void
- tidyUpForces() : void
- update() : void
- updateExpire() : void
- updateRefreshAll() : void
- Update the table fields associated with using Refresh All
- __construct() : mixed
- takeDamageToCDs() : int
- Returns the number of CDs destroyed
- takeDamageToMines() : int
- Returns the number of mines destroyed
- takeDamageToSDs() : int
- Returns the number of SDs destroyed
Constants
LOWEST_MAX_EXPIRE_SCOUTS_ONLY
public
mixed
LOWEST_MAX_EXPIRE_SCOUTS_ONLY
= 432000
MAX_CDS
public
mixed
MAX_CDS
= 50
MAX_MINES
public
mixed
MAX_MINES
= 50
MAX_SDS
public
mixed
MAX_SDS
= 5
REFRESH_ALL_TIME_PER_STACK
public
mixed
REFRESH_ALL_TIME_PER_STACK
= 1
SQL
public
mixed
SQL
= 'game_id = :game_id AND sector_id = :sector_id AND owner_id = :owner_id'
TIME_PER_SCOUT_ONLY
protected
mixed
TIME_PER_SCOUT_ONLY
= 86400
TIME_PERCENT_PER_COMBAT
protected
mixed
TIME_PERCENT_PER_COMBAT
= 0.02
TIME_PERCENT_PER_MINE
protected
mixed
TIME_PERCENT_PER_MINE
= 0.02
TIME_PERCENT_PER_SCOUT
protected
mixed
TIME_PERCENT_PER_SCOUT
= 0.02
Properties
$CACHE_FORCES
protected
static array<int, array<int, array<int, self>>>
$CACHE_FORCES
= []
$CACHE_SECTOR_FORCES
protected
static array<int, array<int, array<int, self>>>
$CACHE_SECTOR_FORCES
= []
$combatDrones
protected
int
$combatDrones
= 0
$expire
protected
int
$expire
= 0
$gameID read-only
protected
int
$gameID
$hasChanged
protected
bool
$hasChanged
= false
$isNew
protected
bool
$isNew
= true
$mines
protected
int
$mines
= 0
$ownerID read-only
protected
int
$ownerID
$scoutDrones
protected
int
$scoutDrones
= 0
$sectorID read-only
protected
int
$sectorID
$SQLID read-only
protected
array{game_id: int, sector_id: int, owner_id: int}
$SQLID
$TIDIED_UP
protected
static array<int, array<int, bool>>
$TIDIED_UP
= []
Methods
__sleep()
public
__sleep() : mixed
addCDs()
public
addCDs(int $amount) : void
Parameters
- $amount : int
addMines()
public
addMines(int $amount) : void
Parameters
- $amount : int
addSDs()
public
addSDs(int $amount) : void
Parameters
- $amount : int
clearCache()
public
static clearCache() : void
exists()
public
exists() : bool
Return values
boolgetAttackForcesHREF()
public
getAttackForcesHREF() : string
Return values
stringgetAttackTurnCost()
public
getAttackTurnCost(AbstractShip $ship) : int
Parameters
- $ship : AbstractShip
Return values
intgetBumpTurnCost()
public
getBumpTurnCost(AbstractShip $ship) : int
Parameters
- $ship : AbstractShip
Return values
intgetCDs()
public
getCDs() : int
Return values
intgetDropCDHREF()
public
getDropCDHREF() : string
Return values
stringgetDropMineHREF()
public
getDropMineHREF() : string
Return values
stringgetDropSDHREF()
public
getDropSDHREF() : string
Return values
stringgetExamineDropForcesHREF()
public
getExamineDropForcesHREF() : string
Return values
stringgetExpire()
public
getExpire() : int
Return values
intgetForce()
public
static getForce(int $gameID, int $sectorID, int $ownerID[, bool $forceUpdate = false ][, DatabaseRecord|null $dbRecord = null ]) : self
Parameters
- $gameID : int
- $sectorID : int
- $ownerID : int
- $forceUpdate : bool = false
- $dbRecord : DatabaseRecord|null = null
Return values
selfgetGalaxy()
public
getGalaxy() : Galaxy
Return values
GalaxygetGalaxyForces()
public
static getGalaxyForces(int $gameID, int $galaxyID[, bool $forceUpdate = false ]) : array<int, array<int, self>>
Parameters
- $gameID : int
- $galaxyID : int
- $forceUpdate : bool = false
Return values
array<int, array<int, self>>getGameID()
public
getGameID() : int
Return values
intgetMaxExpireTime()
public
getMaxExpireTime() : int
Return values
intgetMaxGalaxyExpireTime()
public
getMaxGalaxyExpireTime() : int
Return values
intgetMines()
public
getMines() : int
Return values
intgetOwner()
public
getOwner() : AbstractPlayer
Return values
AbstractPlayergetOwnerID()
public
getOwnerID() : int
Return values
intgetRefreshAllHREF()
public
static getRefreshAllHREF() : string
Return values
stringgetRefreshHREF()
public
getRefreshHREF() : string
Return values
stringgetSDs()
public
getSDs() : int
Return values
intgetSector()
public
getSector() : Sector
Return values
SectorgetSectorForces()
public
static getSectorForces(int $gameID, int $sectorID[, bool $forceUpdate = false ]) : array<int, self>
Parameters
- $gameID : int
- $sectorID : int
- $forceUpdate : bool = false
Return values
array<int, self>getSectorID()
public
getSectorID() : int
Return values
intgetTakeCDHREF()
public
getTakeCDHREF() : string
Return values
stringgetTakeMineHREF()
public
getTakeMineHREF() : string
Return values
stringgetTakeSDHREF()
public
getTakeSDHREF() : string
Return values
stringhasCDs()
public
hasCDs() : bool
Return values
boolhasExpired()
public
hasExpired() : bool
Return values
boolhasMaxCDs()
public
hasMaxCDs() : bool
Return values
boolhasMaxMines()
public
hasMaxMines() : bool
Return values
boolhasMaxSDs()
public
hasMaxSDs() : bool
Return values
boolhasMines()
public
hasMines() : bool
Return values
boolhasSDs()
public
hasSDs() : bool
Return values
boolkillForcesByPlayer()
public
killForcesByPlayer(AbstractPlayer $killer) : array{}
Parameters
- $killer : AbstractPlayer
Return values
array{}ping()
public
ping(string $pingMessage, AbstractPlayer $playerPinging[, bool $skipCheck = false ]) : void
Parameters
- $pingMessage : string
- $playerPinging : AbstractPlayer
- $skipCheck : bool = false
saveForces()
public
static saveForces() : void
setCDs()
public
setCDs(int $amount) : void
Parameters
- $amount : int
setExpire()
public
setExpire(int $time) : void
Parameters
- $time : int
setMines()
public
setMines(int $amount) : void
Parameters
- $amount : int
setSDs()
public
setSDs(int $amount) : void
Parameters
- $amount : int
shootPlayers()
public
shootPlayers(array<string|int, AbstractPlayer> $targetPlayers, bool $minesAreAttacker) : ForceCombatResults
Parameters
- $targetPlayers : array<string|int, AbstractPlayer>
- $minesAreAttacker : bool
Return values
ForceCombatResultstakeCDs()
public
takeCDs(int $amount) : void
Parameters
- $amount : int
takeDamage()
public
takeDamage(WeaponDamageData $damage) : ForceTakenDamageData
Parameters
- $damage : WeaponDamageData
Return values
ForceTakenDamageDatatakeMines()
public
takeMines(int $amount) : void
Parameters
- $amount : int
takeSDs()
public
takeSDs(int $amount) : void
Parameters
- $amount : int
tidyUpForces()
public
static tidyUpForces(Galaxy $galaxyToTidy) : void
Parameters
- $galaxyToTidy : Galaxy
update()
public
update() : void
updateExpire()
public
updateExpire() : void
updateRefreshAll()
Update the table fields associated with using Refresh All
public
updateRefreshAll(AbstractPlayer $player, int $refreshTime) : void
Parameters
- $player : AbstractPlayer
- $refreshTime : int
__construct()
protected
__construct(int $gameID, int $sectorID, int $ownerID[, DatabaseRecord|null $dbRecord = null ]) : mixed
Parameters
- $gameID : int
- $sectorID : int
- $ownerID : int
- $dbRecord : DatabaseRecord|null = null
takeDamageToCDs()
Returns the number of CDs destroyed
protected
takeDamageToCDs(int $damage) : int
Parameters
- $damage : int
Return values
inttakeDamageToMines()
Returns the number of mines destroyed
protected
takeDamageToMines(int $damage) : int
Parameters
- $damage : int
Return values
inttakeDamageToSDs()
Returns the number of SDs destroyed
protected
takeDamageToSDs(int $damage) : int
Parameters
- $damage : int