Fleet
extends Model
in package
Fleet Class
Table of Contents
- $db : Database
- Contains the Database instance
- __construct() : mixed
- Constructor
- __destruct() : mixed
- Destructor
- createNewAcs() : bool
- Create a new ACS Record
- getAcsCount() : int
- Get ACS count
- getAcsDataByGroupId() : array<string|int, mixed>
- Get ACS Data by group ID
- getAcsMaxTime() : string
- Get ACS Max Time
- getAcsOwner() : string
- Get the ACS Owner
- getAllFleetsByUserId() : array<string|int, mixed>
- Get all fleets by user id or owner
- getAllPlanetsByUserId() : array<string|int, mixed>
- Get all user planets
- getBuddies() : array<string|int, mixed>
- Get buddies
- getListOfAcsMembers() : array<string|int, mixed>
- Get all the ACS Members
- getOngoingAcs() : mixed
- Get ongoing ACS attacks
- getPlanetOwnerByCoords() : bool
- Get planet owner by coords
- getShipsByPlanetId() : array<string|int, mixed>
- Get ships by planet id
- getTargetDataByCoords() : array<string|int, mixed>
- Get target data by coords
- getUserIdByName() : int
- Get the user name by ID
- insertNewAcsMember() : void
- Create a new ACS Member
- insertNewFleet() : bool
- Insert a new fleet
- insertNewMissilesMission() : void
- Insert a new missiles mission into the fleets table
- removeAcs() : void
- Remove an ACS fleet
- removeAcsMember() : void
- Remove an ACS Member
- returnFleet() : bool
- Return the fleet to its start planet
- updateAcsName() : void
- Update ACS Name
- updateAcsTimes() : void
- Update ACS Fleets Times
- updatePlanet() : void
- Update planet based on the received values
- setNewDb() : void
- Creates a new Database object
Properties
$db
Contains the Database instance
protected
Database
$db
Methods
__construct()
Constructor
public
__construct() : mixed
Return values
mixed —__destruct()
Destructor
public
__destruct() : mixed
Return values
mixed —createNewAcs()
Create a new ACS Record
public
createNewAcs(type $acs_code, FleetEntity $fleet) : bool
Parameters
- $acs_code : type
- $fleet : FleetEntity
Return values
bool —getAcsCount()
Get ACS count
public
getAcsCount(type $acs_id) : int
Parameters
- $acs_id : type
Return values
int —getAcsDataByGroupId()
Get ACS Data by group ID
public
getAcsDataByGroupId(int $group_id) : array<string|int, mixed>
Parameters
- $group_id : int
Return values
array<string|int, mixed> —getAcsMaxTime()
Get ACS Max Time
public
getAcsMaxTime(int $group_id) : string
Parameters
- $group_id : int
-
Group ID
Return values
string —getAcsOwner()
Get the ACS Owner
public
getAcsOwner(int $fleet_group) : string
Parameters
- $fleet_group : int
Return values
string —getAllFleetsByUserId()
Get all fleets by user id or owner
public
getAllFleetsByUserId(int $user_id) : array<string|int, mixed>
Parameters
- $user_id : int
-
User ID
Return values
array<string|int, mixed> —getAllPlanetsByUserId()
Get all user planets
public
getAllPlanetsByUserId(int $user_id) : array<string|int, mixed>
Parameters
- $user_id : int
-
User ID
Return values
array<string|int, mixed> —getBuddies()
Get buddies
public
getBuddies(int $current_planet, int $target_planet) : array<string|int, mixed>
Parameters
- $current_planet : int
-
Current Planet ID
- $target_planet : int
-
Target Planet ID
Return values
array<string|int, mixed> —getListOfAcsMembers()
Get all the ACS Members
public
getListOfAcsMembers(int $group_id) : array<string|int, mixed>
Parameters
- $group_id : int
Return values
array<string|int, mixed> —getOngoingAcs()
Get ongoing ACS attacks
public
getOngoingAcs(int $user_id) : mixed
Parameters
- $user_id : int
Return values
mixed —getPlanetOwnerByCoords()
Get planet owner by coords
public
getPlanetOwnerByCoords(int $g, int $s, int $p, int $pt) : bool
Parameters
- $g : int
-
Galaxy
- $s : int
-
System
- $p : int
-
Planet
- $pt : int
-
Planet Type
Return values
bool —getShipsByPlanetId()
Get ships by planet id
public
getShipsByPlanetId(int $planet_id) : array<string|int, mixed>
Parameters
- $planet_id : int
-
Planet ID
Return values
array<string|int, mixed> —getTargetDataByCoords()
Get target data by coords
public
getTargetDataByCoords(int $g, int $s, int $p, int $pt) : array<string|int, mixed>
Parameters
- $g : int
-
Galaxy
- $s : int
-
System
- $p : int
-
Planet
- $pt : int
-
Planet Type
Return values
array<string|int, mixed> —getUserIdByName()
Get the user name by ID
public
getUserIdByName(string $user_name, int $group_id) : int
Parameters
- $user_name : string
-
User Name
- $group_id : int
Return values
int —insertNewAcsMember()
Create a new ACS Member
public
insertNewAcsMember(int $member, int $group_id) : void
Parameters
- $member : int
- $group_id : int
Return values
void —insertNewFleet()
Insert a new fleet
public
insertNewFleet(array<string|int, mixed> $fleet_data, array<string|int, mixed> $planet_data, array<string|int, mixed> $fleet_ships) : bool
Parameters
- $fleet_data : array<string|int, mixed>
- $planet_data : array<string|int, mixed>
- $fleet_ships : array<string|int, mixed>
Return values
bool —insertNewMissilesMission()
Insert a new missiles mission into the fleets table
public
insertNewMissilesMission(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Return values
void —removeAcs()
Remove an ACS fleet
public
removeAcs(int $fleet_group) : void
Parameters
- $fleet_group : int
Return values
void —removeAcsMember()
Remove an ACS Member
public
removeAcsMember(int $member, int $group_id) : void
Parameters
- $member : int
- $group_id : int
Return values
void —returnFleet()
Return the fleet to its start planet
public
returnFleet(FleetEntity $fleet, int $user_id) : bool
Parameters
- $fleet : FleetEntity
- $user_id : int
-
Current user ID
Return values
bool —updateAcsName()
Update ACS Name
public
updateAcsName(string $acs_name, int $acs_id, int $user_id) : void
Parameters
- $acs_name : string
- $acs_id : int
- $user_id : int
Return values
void —updateAcsTimes()
Update ACS Fleets Times
public
updateAcsTimes(int $group_id, int $start_time, int $end_time) : void
Parameters
- $group_id : int
-
Group ID
- $start_time : int
-
Start Time
- $end_time : int
-
End Time
Return values
void —updatePlanet()
Update planet based on the received values
public
updatePlanet(array<string|int, mixed> $planet_data, array<string|int, mixed> $fleet_data, array<string|int, mixed> $fleet_ships) : void
Parameters
- $planet_data : array<string|int, mixed>
-
Planet Data
- $fleet_data : array<string|int, mixed>
-
Fleet Data
- $fleet_ships : array<string|int, mixed>
-
Fleet Ships
Return values
void —setNewDb()
Creates a new Database object
private
setNewDb() : void