\K_Unit_Transformation

Unit transformation.

Represents an object from the table 'k_unit_transformation'.

Summary

Methods
Properties
Constants
__construct()
get_image()
$db
$id
$family
$unit
$skill
No constants found
No protected methods found
No protected properties found
N/A
load_skills()
No private properties found
N/A

Properties

$db

$db : resource

Type

resource — Database connection.

$id

$id : integer

Type

integer — Transformed unit identifier.

$family

$family : integer

Type

integer — Transformed unit family id.

$unit

$unit : integer

Type

integer — ID of the unit that transformes into this.

$skill

$skill : array<mixed,\K_Monster_Skill>

Type

array<mixed,\K_Monster_Skill> — Skills in the transformed form.

Methods

__construct()

__construct(resource  $db, integer  $id) 

Constructor.

Searches the database and retrieves the information about the trnsformed unit, populating it and it's items.

Parameters

resource $db

Connection to the database.

integer $id

TRansformed unit identifier.

get_image()

get_image() : string

Gets the path to the unit image. The image must be in the img/unit/ directory, and it's name must be the unit id, padded with '0' to 8 digits, and the extension must be '.png'.

Returns

string —

Image URL, or a fixed unknown image.

load_skills()

load_skills() 

Loads the information about the unit skills in the transformed form.