Add time to task finish
This commit is contained in:
parent
acba0b2328
commit
b2038dcc69
@ -10,8 +10,8 @@
|
||||
## Управление
|
||||
|
||||
- [x] Цикл ввода-вывода
|
||||
- [ ] Просмотр задач в очереди
|
||||
- [ ] Время завершения задачи при создании
|
||||
- [x] Просмотр задач в очереди
|
||||
- [x] Время завершения задачи при создании
|
||||
- [x] Сообщение о выйгрыше
|
||||
|
||||
## Механики
|
||||
|
@ -85,8 +85,15 @@ def render_commands(world)
|
||||
if items.size != 0
|
||||
printf "Queue:\n"
|
||||
end
|
||||
wts = world.ts
|
||||
items.each do |i|
|
||||
printf " %s, %s\n", render_time(i.ts), i.command.desc
|
||||
ts_diff = i.ts - wts
|
||||
if ts_diff < 60
|
||||
done_time = sprintf " %02ds", ts_diff
|
||||
else
|
||||
done_time = sprintf "%d:%02d", ts_diff // 60, ts_diff % 60
|
||||
end
|
||||
printf " %s, %s, %s\n", render_time(i.ts), done_time, i.command.desc
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user