lwb5-in-2025/scripts/game/main/library/getTicks.inc

32 lines
642 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class main_getTicks {
public function __construct($lib) {
2016-01-10 11:01:49 +01:00
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
function run($lang = null) {
$ticks = array();
foreach ($this->lib->game->ticks as $script => $tInst) {
$tick = array(
"script" => $script,
"game" => $tInst->definition->public,
"first" => $tInst->first,
"last" => $tInst->last,
"interval" => $tInst->interval
);
if (!is_null($lang)) {
$tick['name'] = $tInst->definition->getName($lang);
$tick['description'] = $tInst->definition->getDescription($lang);
}
array_push($ticks, $tick);
}
return $ticks;
}
}
?>