| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | final class ProgressFrameProcedure extends AProgressValueProcedure |
||
| 15 | { |
||
| 16 | private int $steps; |
||
| 17 | |||
| 18 | public function __construct( |
||
| 19 | IProgressValue $progressValue, |
||
| 20 | protected IFrameCollection $frames, |
||
| 21 | ) { |
||
| 22 | parent::__construct($progressValue); |
||
| 23 | $this->steps = $frames->lastIndex(); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function update(float $dt = null): IFrame |
||
| 27 | { |
||
| 28 | if ($this->progressValue->isFinished()) { |
||
| 29 | if ($this->finishedDelay < 0) { |
||
| 30 | return FrameFactory::createEmpty(); |
||
| 31 | } |
||
| 32 | $this->finishedDelay -= $dt ?? 0.0; |
||
| 33 | } |
||
| 34 | return |
||
| 35 | $this->getFrame($this->floatValue->getValue()); |
||
| 36 | } |
||
| 37 | |||
| 38 | private function getFrame(float $progress): IFrame |
||
| 43 | } |
||
| 44 | } |
||
| 45 |