AridPlanet
extends PlanetType
in package
Defines intrinsic properties of planet types.
Table of Contents
Constants
- PLANET_TYPES = [1 => \Smr\PlanetTypes\TerranPlanet::class, 2 => \Smr\PlanetTypes\AridPlanet::class, 3 => \Smr\PlanetTypes\DwarfPlanet::class, 4 => \Smr\PlanetTypes\DefenseWorld::class, 5 => \Smr\PlanetTypes\ProtoPlanet::class]
- Associates the planet_type_id with the planet class.
- STRUCTURES = [PLANET_GENERATOR => ['max_amount' => 25, 'base_time' => 10800, 'credit_cost' => 100000, 'exp_gain' => 90], PLANET_BUNKER => ['max_amount' => 25, 'base_time' => 10800, 'credit_cost' => 50000, 'exp_gain' => 90], PLANET_TURRET => ['max_amount' => 15, 'base_time' => 21600, 'credit_cost' => 750000, 'exp_gain' => 180]]
- MAX_LANDED_UNLIMITED = 0
Properties
- $structures : array<int, PlanetStructureType>
Methods
- description() : string
- getTypeInfo() : self
- Returns an instance of the planet type from the given $typeID.
- imageLink() : string
- maxAttackers() : int
- maxLanded() : int
- menuOptions() : array<string|int, PlanetMenuOption>
- name() : string
- structureTypes() : PlanetStructureType|array<int, PlanetStructureType>
- Access properties of structures that this planet type can build.
- getStructureData() : array<int, array<string, int>>
- Returns the properties of all the structures this planet type can build.
Constants
PLANET_TYPES
Associates the planet_type_id with the planet class.
public
mixed
PLANET_TYPES
= [1 => \Smr\PlanetTypes\TerranPlanet::class, 2 => \Smr\PlanetTypes\AridPlanet::class, 3 => \Smr\PlanetTypes\DwarfPlanet::class, 4 => \Smr\PlanetTypes\DefenseWorld::class, 5 => \Smr\PlanetTypes\ProtoPlanet::class]
These indices must not be changed!
STRUCTURES
public
mixed
STRUCTURES
= [PLANET_GENERATOR => ['max_amount' => 25, 'base_time' => 10800, 'credit_cost' => 100000, 'exp_gain' => 90], PLANET_BUNKER => ['max_amount' => 25, 'base_time' => 10800, 'credit_cost' => 50000, 'exp_gain' => 90], PLANET_TURRET => ['max_amount' => 15, 'base_time' => 21600, 'credit_cost' => 750000, 'exp_gain' => 180]]
MAX_LANDED_UNLIMITED
protected
mixed
MAX_LANDED_UNLIMITED
= 0
Properties
$structures
private
array<int, PlanetStructureType>
$structures
Methods
description()
public
description() : string
Return values
stringgetTypeInfo()
Returns an instance of the planet type from the given $typeID.
public
static getTypeInfo(int $typeID) : self
This is the intended method to construct a PlanetType child class.
Parameters
- $typeID : int
Return values
selfimageLink()
public
imageLink() : string
Return values
stringmaxAttackers()
public
maxAttackers() : int
Return values
intmaxLanded()
public
maxLanded() : int
Return values
intmenuOptions()
public
menuOptions() : array<string|int, PlanetMenuOption>
Return values
array<string|int, PlanetMenuOption>name()
public
name() : string
Return values
stringstructureTypes()
Access properties of structures that this planet type can build.
public
structureTypes([int|null $structureID = null ]) : PlanetStructureType|array<int, PlanetStructureType>
Parameters
- $structureID : int|null = null
Return values
PlanetStructureType|array<int, PlanetStructureType>getStructureData()
Returns the properties of all the structures this planet type can build.
protected
getStructureData() : array<int, array<string, int>>
We could access static::STRUCTURES directly (late static binding), but that confuses static analyzers, since there is no STRUCTURES const in the base class (nor should there be).