-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from exodus4d/develop
v0.0.16
- Loading branch information
Showing
61 changed files
with
496 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: exodus4d | ||
* Date: 07.06.15 | ||
* Time: 18:16 | ||
*/ | ||
|
||
namespace Model; | ||
|
||
|
||
class SystemWormholeModel extends BasicModel { | ||
|
||
protected $table = 'system_wormhole'; | ||
|
||
protected $fieldConf = [ | ||
'wormholeId' => [ | ||
'belongs-to-one' => 'Model\WormholeModel' | ||
] | ||
]; | ||
|
||
/** | ||
* get wormhole data as object | ||
* @return object | ||
*/ | ||
public function getData(){ | ||
|
||
$systemWormholeData = $this->wormholeId->getData(); | ||
|
||
return $systemWormholeData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Exodus | ||
* Date: 14.11.2015 | ||
* Time: 22:21 | ||
*/ | ||
|
||
namespace Model; | ||
|
||
class WormholeModel extends BasicModel { | ||
|
||
protected $table = 'wormhole'; | ||
|
||
/** | ||
* format mass values | ||
* - no decimal separator | ||
* - char '.' for thousands separator | ||
* @param $value | ||
* @return string | ||
*/ | ||
static function formatMassValue($value){ | ||
return number_format( $value, 0, '', '.' ); | ||
} | ||
|
||
/** | ||
* get wormhole data as object | ||
* @return object | ||
*/ | ||
public function getData(){ | ||
|
||
$systemStaticData = (object) []; | ||
$systemStaticData->name = $this->name; | ||
$systemStaticData->security = $this->security; | ||
|
||
// total (max) available wormhole mass | ||
$systemStaticData->massTotal = (object) []; | ||
$systemStaticData->massTotal->value = $this->massTotal; | ||
$systemStaticData->massTotal->format = self::formatMassValue($this->massTotal) . ' Kg'; | ||
|
||
// individual jump mass (max) per jump | ||
$systemStaticData->massIndividual = (object) []; | ||
$systemStaticData->massIndividual->value = $this->massIndividual; | ||
$systemStaticData->massIndividual->format = self::formatMassValue($this->massIndividual) . ' Kg'; | ||
|
||
// lifetime (max) for this wormhole | ||
$systemStaticData->maxStableTime = (object) []; | ||
$systemStaticData->maxStableTime->value = $this->maxStableTime; | ||
$systemStaticData->maxStableTime->format = $this->maxStableTime . ' h'; | ||
|
||
// mass regeneration value per day | ||
if($this->massRegeneration > 0){ | ||
$systemStaticData->massRegeneration = (object) []; | ||
$systemStaticData->massRegeneration->value = $this->massRegeneration; | ||
$systemStaticData->massRegeneration->format = self::formatMassValue($this->massRegeneration) . ' Kg/day'; | ||
} | ||
|
||
return $systemStaticData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.