XG Proyect

Resources extends BaseController
in package

Resources Class

Table of Contents

MODULE_ID  = 4
$objects  : Objects
Contains the whole set of objects by request
$page  : Page
Contains the Page object
$planet  : array<string|int, mixed>
Contains the current planet data
$template  : Template
Contains the Template object
$user  : array<string|int, mixed>
Contains the current user data
$userLibrary  : User
Contains the User object
$_prod_grid  : mixed
$_reslist  : mixed
$_resource  : mixed
__construct()  : mixed
Constructor
index()  : void
Users land here
loadLang()  : void
Load a language file using CI Library
loadModel()  : void
Load the provided model, support a dir path
getObjects()  : array<string|int, mixed>
Will be removed
getPlanetData()  : array<string|int, mixed>
Will be removed
getTemplate()  : array<string|int, mixed>
Will be removed
getUserData()  : array<string|int, mixed>
Will be removed
build_options()  : mixed
method build_options param $current_percentage return percentage options for the select element
buildPage()  : void
Build the page
calculate_daily()  : mixed
method calculate_daily param1 $prod_per_hour param2 $prod_level param3 $basic_income return production per day
calculate_weekly()  : mixed
method calculate_weekly param1 $prod_per_hour param2 $prod_level param3 $basic_income return production per week
prod_level()  : mixed
method prod_level param1 $energy_used param2 $energy_max return the production level based on the energy consumption
resource_color()  : mixed
method resource_color param1 $current_amount param2 $max_amount return color depending on the current storage capacity

Constants

Properties

$planet

Contains the current planet data

protected array<string|int, mixed> $planet = []

$user

Contains the current user data

protected array<string|int, mixed> $user = []

$userLibrary

Contains the User object

protected User $userLibrary = null

Methods

__construct()

Constructor

public __construct() : mixed
Return values
mixed

index()

Users land here

public index() : void
Return values
void

loadLang()

Load a language file using CI Library

public loadLang(string|array<string|int, mixed> $language_file) : void
Parameters
$language_file : string|array<string|int, mixed>
Return values
void

loadModel()

Load the provided model, support a dir path

public loadModel(string $class) : void
Parameters
$class : string

Mandatory field, if not will throw an exception

Tags
throws
Exception
Return values
void

getObjects()

Will be removed

protected getObjects() : array<string|int, mixed>
Tags
deprecated

since 3.2.0 will be removed on 4.0.0

Return values
array<string|int, mixed>

getPlanetData()

Will be removed

protected getPlanetData() : array<string|int, mixed>
Tags
deprecated

since 3.2.0 will be removed on 4.0.0

Return values
array<string|int, mixed>

getTemplate()

Will be removed

protected getTemplate() : array<string|int, mixed>
Tags
deprecated

since 3.2.0 will be removed on 4.0.0

Return values
array<string|int, mixed>

getUserData()

Will be removed

protected getUserData() : array<string|int, mixed>
Tags
deprecated

since 3.2.0 will be removed on 4.0.0

Return values
array<string|int, mixed>

build_options()

method build_options param $current_percentage return percentage options for the select element

private build_options(mixed $current_porcentage) : mixed
Parameters
$current_porcentage : mixed
Return values
mixed

buildPage()

Build the page

private buildPage() : void
Return values
void

calculate_daily()

method calculate_daily param1 $prod_per_hour param2 $prod_level param3 $basic_income return production per day

private calculate_daily(mixed $prod_per_hour, mixed $prod_level, mixed $basic_income) : mixed
Parameters
$prod_per_hour : mixed
$prod_level : mixed
$basic_income : mixed
Return values
mixed

calculate_weekly()

method calculate_weekly param1 $prod_per_hour param2 $prod_level param3 $basic_income return production per week

private calculate_weekly(mixed $prod_per_hour, mixed $prod_level, mixed $basic_income) : mixed
Parameters
$prod_per_hour : mixed
$prod_level : mixed
$basic_income : mixed
Return values
mixed

prod_level()

method prod_level param1 $energy_used param2 $energy_max return the production level based on the energy consumption

private prod_level(mixed $energy_used, mixed $energy_max) : mixed
Parameters
$energy_used : mixed
$energy_max : mixed
Return values
mixed

resource_color()

method resource_color param1 $current_amount param2 $max_amount return color depending on the current storage capacity

private resource_color(mixed $current_amount, mixed $max_amount) : mixed
Parameters
$current_amount : mixed
$max_amount : mixed
Return values
mixed

Search results