nur-sery/wip/tools/SteamTrainApp.php

29 lines
614 B
PHP
Raw Normal View History

2024-09-25 17:10:14 +04:00
<?php
namespace nur\sery\wip\tools;
use nur\sery\output\msg;
use nur\sery\wip\app\app2;
use nur\sery\wip\app\cli\Application;
class SteamTrainApp extends Application {
const TITLE = "Train à vapeur";
const USE_SIGNAL_HANDLER = true;
const USE_LOGFILE = true;
const USE_RUNFILE = true;
const USE_RUNLOCK = true;
const ARGS = [
"purpose" => self::TITLE,
];
function main() {
$runfile = app2::get()->getRunfile();
$runfile->action("Running train...", 100);
for ($i = 1; $i <= 100; $i++) {
msg::print("Tchou-tchou! x $i");
$runfile->step();
sleep(1);
}
}
}