2016-01-10 11:01:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class beta5_fleet_getUpkeep {
|
|
|
|
|
2024-12-31 00:50:29 +01:00
|
|
|
public function __construct($lib) {
|
2016-01-10 11:01:49 +01:00
|
|
|
$this->lib = $lib;
|
|
|
|
$this->db = $this->lib->game->db;
|
|
|
|
$this->rules = $this->lib->game->getLib('beta5/rules');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Computes a fleet's upkeep
|
|
|
|
function run($pl, $g, $f, $c, $b) {
|
|
|
|
$r = $this->rules->call('get', $pl);
|
|
|
|
$fu = $g * $r['gaship_upkeep'];
|
|
|
|
$fu += $f * $r['fighter_upkeep'];
|
|
|
|
$fu += $c * $r['cruiser_upkeep'];
|
|
|
|
$fu += $b * $r['bcruiser_upkeep'];
|
|
|
|
return $fu;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|