FleetsLib
extends XGPCore
in package
FleetsLib Class
Tags
Table of Contents
- $lang : mixed
- $objects : mixed
- __construct() : void
- __construct
- enemyLink() : string
- enemyLink
- fleetConsumption() : int
- fleetConsumption
- fleetMaxSpeed() : int
- fleetMaxSpeed
- fleetResourcesPopup() : void
- fleetResourcesPopup
- fleetShipsPopup() : void
- fleetShipsPopup
- flyingFleetsTable() : void
- flyingFleetsTable
- getFleetShipsArray() : array<string|int, mixed>
- Un-serialize the fleet array
- getMaxColonies() : int
- getMaxColonies
- getMaxExpeditions() : int
- getMaxExpeditions
- getMaxFleets() : int
- getMaxFleets
- getMaxStorage() : int
- Get max ship storage
- hasResources() : bool
- Check if the fleet has resources
- isFleetReturning() : bool
- isFleetReturning
- missionDuration() : int
- The formula calculates the mission duration
- setFleetShipsArray() : string
- Serialize the fleet array
- shipConsumption() : void
- Determine ship consumption
- startLink() : string
- startLink
- targetDistance() : int
- targetDistance
- targetLink() : string
- targetLink
- loadLang() : void
- Load a language file using CI Library
- getTemplate() : Template
- Return a new instance of Template
- loadLanguage() : void
- Load CI language
- setObjectsClass() : void
- setObjectsClass
Properties
$lang
protected
static mixed
$lang
$objects
protected
static mixed
$objects
Methods
__construct()
__construct
public
__construct() : void
Return values
void —enemyLink()
enemyLink
public
static enemyLink(array<string|int, mixed> $fleet_row) : string
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
Return values
string —fleetConsumption()
fleetConsumption
public
static fleetConsumption(array<string|int, mixed> $fleet_array, int $speed_factor, int $mission_duration, int $mission_distance, array<string|int, mixed> $user) : int
Parameters
- $fleet_array : array<string|int, mixed>
-
Fleet
- $speed_factor : int
-
Speed factor
- $mission_duration : int
-
Mission duration
- $mission_distance : int
-
Mission distance
- $user : array<string|int, mixed>
-
User
Return values
int —fleetMaxSpeed()
fleetMaxSpeed
public
static fleetMaxSpeed(array<string|int, mixed> $fleet_array, int $fleet, string $user) : int
Parameters
- $fleet_array : array<string|int, mixed>
-
Fleet
- $fleet : int
-
Fleed id
- $user : string
-
User
Return values
int —fleetResourcesPopup()
fleetResourcesPopup
public
static fleetResourcesPopup(array<string|int, mixed> $fleet_row, string $text, string $fleet_type) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
- $text : string
-
Text
- $fleet_type : string
-
Fleet type
Return values
void —fleetShipsPopup()
fleetShipsPopup
public
static fleetShipsPopup(array<string|int, mixed> $fleet_row, string $text, string $fleet_type[, array<string|int, mixed> $current_user = '' ]) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
- $text : string
-
Text
- $fleet_type : string
-
Fleet type
- $current_user : array<string|int, mixed> = ''
-
Current user
Return values
void —flyingFleetsTable()
flyingFleetsTable
public
static flyingFleetsTable(array<string|int, mixed> $fleet_row, string $Status, int $Owner, string $Label, string $Record, string $current_user[, mixed $acs_owner = false ]) : void
Parameters
- $fleet_row : array<string|int, mixed>
-
Fleet row
- $Status : string
-
Status
- $Owner : int
-
Owner
- $Label : string
-
Label
- $Record : string
-
Record
- $current_user : string
-
Current user
- $acs_owner : mixed = false
Return values
void —getFleetShipsArray()
Un-serialize the fleet array
public
static getFleetShipsArray(string $fleet_array) : array<string|int, mixed>
Parameters
- $fleet_array : string
-
Fleet array
Return values
array<string|int, mixed> —getMaxColonies()
getMaxColonies
public
static getMaxColonies(int $astrophysics_tech) : int
Parameters
- $astrophysics_tech : int
-
Astrophysics Tech level
Return values
int —getMaxExpeditions()
getMaxExpeditions
public
static getMaxExpeditions(int $astrophysics_tech) : int
Parameters
- $astrophysics_tech : int
-
Astrophysics Tech level
Return values
int —getMaxFleets()
getMaxFleets
public
static getMaxFleets(int $computer_tech, int $amiral_level) : int
Parameters
- $computer_tech : int
-
Computer tech level
- $amiral_level : int
-
Amiral available
Return values
int —getMaxStorage()
Get max ship storage
public
static getMaxStorage(int $ship_storage, int $hyperspace_tech_level) : int
Parameters
- $ship_storage : int
- $hyperspace_tech_level : int
Return values
int —hasResources()
Check if the fleet has resources
public
static hasResources(array<string|int, mixed> $fleet) : bool
Parameters
- $fleet : array<string|int, mixed>
Return values
bool —isFleetReturning()
isFleetReturning
public
static isFleetReturning(array<string|int, mixed> $fleet_mess) : bool
Parameters
- $fleet_mess : array<string|int, mixed>
-
Fleet mess
Return values
bool —missionDuration()
The formula calculates the mission duration
public
static missionDuration(int $percentage, int $max_fleet_speed, int $distance, int $speed_factor) : int
Parameters
- $percentage : int
-
The speed percentage set by the user
- $max_fleet_speed : int
-
Max fleet speed
- $distance : int
-
The distance
- $speed_factor : int
-
The game speed factor
Return values
int —setFleetShipsArray()
Serialize the fleet array
public
static setFleetShipsArray(array<string|int, mixed> $fleet_array) : string
Parameters
- $fleet_array : array<string|int, mixed>
-
Fleet array
Return values
string —shipConsumption()
Determine ship consumption
public
static shipConsumption(int $ship, array<string|int, mixed> $user) : void
Parameters
- $ship : int
- $user : array<string|int, mixed>
Return values
void —startLink()
startLink
public
static startLink(array<string|int, mixed> $fleet_row, string $fleet_type) : string
Parameters
- $fleet_row : array<string|int, mixed>
- $fleet_type : string
Return values
string —targetDistance()
targetDistance
public
static targetDistance(int $orig_galaxy, int $dest_galaxy, int $orig_system, int $dest_system, int $orig_planet, int $dest_planet) : int
Parameters
- $orig_galaxy : int
-
Origin Galaxy
- $dest_galaxy : int
-
Destiny Ga
- $orig_system : int
-
Origin System
- $dest_system : int
-
Destiny System
- $orig_planet : int
-
Origin Planet
- $dest_planet : int
-
Destiny Planet
Return values
int —targetLink()
targetLink
public
static targetLink(array<string|int, mixed> $fleet_row, string $fleet_type) : string
Parameters
- $fleet_row : array<string|int, mixed>
- $fleet_type : string
Return values
string —loadLang()
Load a language file using CI Library
protected
loadLang(string|array<string|int, mixed> $language_file) : void
Parameters
- $language_file : string|array<string|int, mixed>
Return values
void —getTemplate()
Return a new instance of Template
private
static getTemplate() : Template
Return values
Template —loadLanguage()
Load CI language
private
static loadLanguage(array<string|int, mixed> $required_lang) : void
Parameters
- $required_lang : array<string|int, mixed>
Return values
void —setObjectsClass()
setObjectsClass
private
setObjectsClass() : void