| 1 | <?php |
||
| 5 | class AchievementCriteriaProgress |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var int |
||
| 9 | */ |
||
| 10 | public $value = 0; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var bool |
||
| 14 | */ |
||
| 15 | public $changed = false; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var bool |
||
| 19 | */ |
||
| 20 | public $completed = false; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | public $data = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * AchievementCriteriaProgress constructor. |
||
| 29 | * |
||
| 30 | * @param int $value |
||
| 31 | * @param bool $changed |
||
| 32 | * @param bool $completed |
||
| 33 | * @param array $data = [] |
||
| 34 | */ |
||
| 35 | public function __construct(int $value, bool $changed = false, bool $completed = false, array $data = []) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Calculates new progress value. |
||
| 45 | * |
||
| 46 | * @param int $maxValue |
||
| 47 | * @param int $changeValue |
||
| 48 | * @param string $progressType |
||
| 49 | * |
||
| 50 | * @throws \InvalidArgumentException |
||
| 51 | * |
||
| 52 | * @return int |
||
| 53 | */ |
||
| 54 | public function getNewValue(int $maxValue, int $changeValue, string $progressType) |
||
| 76 | } |
||
| 77 |