Total Complexity | 5 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | final class ProgressStepsProcedure extends AProgressValueProcedure |
||
14 | { |
||
15 | private float $stepValue; |
||
16 | |||
17 | public function __construct(IProgressValue $progressValue) |
||
18 | { |
||
19 | parent::__construct($progressValue); |
||
20 | $this->stepValue = ($progressValue->getMax() - $progressValue->getMin()) / $progressValue->getSteps(); |
||
21 | } |
||
22 | |||
23 | public function update(float $dt = null): IFrame |
||
24 | { |
||
25 | if ($this->progressValue->isFinished()) { |
||
26 | if ($this->finishedDelay < 0) { |
||
27 | return FrameFactory::createEmpty(); |
||
28 | } |
||
29 | $this->finishedDelay -= $dt ?? 0.0; |
||
30 | } |
||
31 | $v = $this->createSteps($this->progressValue); |
||
32 | return |
||
33 | FrameFactory::create($v); |
||
34 | } |
||
35 | |||
36 | private function createSteps(IProgressValue $fractionValue): string |
||
40 | } |
||
41 | } |
||
42 |