Documentation

ProtoPlanet 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' => 5, 'base_time' => 10800, 'credit_cost' => 100000, 'exp_gain' => 90], PLANET_HANGAR => ['max_amount' => 50, 'base_time' => 21600, 'credit_cost' => 100000, 'exp_gain' => 180], PLANET_BUNKER => ['max_amount' => 15, 'base_time' => 10800, 'credit_cost' => 50000, 'exp_gain' => 90], PLANET_WEAPON_MOUNT => ['max_amount' => 20, 'base_time' => 32400, 'credit_cost' => 300000, 'exp_gain' => 270], PLANET_RADAR => ['max_amount' => 10, 'base_time' => 64800, 'credit_cost' => 1000000, 'exp_gain' => 540]]
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' => 5, 'base_time' => 10800, 'credit_cost' => 100000, 'exp_gain' => 90], PLANET_HANGAR => ['max_amount' => 50, 'base_time' => 21600, 'credit_cost' => 100000, 'exp_gain' => 180], PLANET_BUNKER => ['max_amount' => 15, 'base_time' => 10800, 'credit_cost' => 50000, 'exp_gain' => 90], PLANET_WEAPON_MOUNT => ['max_amount' => 20, 'base_time' => 32400, 'credit_cost' => 300000, 'exp_gain' => 270], PLANET_RADAR => ['max_amount' => 10, 'base_time' => 64800, 'credit_cost' => 1000000, 'exp_gain' => 540]]

MAX_LANDED_UNLIMITED

protected mixed MAX_LANDED_UNLIMITED = 0

Properties

Methods

description()

public description() : string
Return values
string

getTypeInfo()

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
self
public imageLink() : string
Return values
string

maxAttackers()

public maxAttackers() : int
Return values
int

maxLanded()

public maxLanded() : int
Return values
int

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).

Return values
array<int, array<string, int>>

        
On this page

Search results