Lines
100.00%
12 / 12
Methods
100.00%
1 / 1
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| selling | 100.00% | 12 / 12 | 100.00% | 1 / 1 | 11 | ||
| 11 | final readonly class EnhancementShops | |
| 12 | { | |
| 13 | private const int HIGHER_SHOPS_FROM_LEVEL = 50; | |
| 14 | ||
| 15 | public static function selling(EnhancementType $type, PlayerLevel $level): ?ShopId | |
| 16 | { | |
| 17 | $shops = match ($type) { | |
| 18 | EnhancementType::Fighter => [141, 768], | |
| 19 | EnhancementType::Thief => [142, 767], | |
| 20 | EnhancementType::Hybrid => [143, 766], | |
| 21 | EnhancementType::Wizard => [144, 765], | |
| 22 | EnhancementType::Healer => [145, 762], | |
| 23 | EnhancementType::SpellBreaker => [146, 764], | |
| 24 | EnhancementType::Lucky => [147, 763], | |
| 25 | EnhancementType::Adventurer, EnhancementType::Unhandled => null, | |
| 26 | }; | |
| 27 | if ($shops === null) { | |
| 28 | return null; | |
| 29 | } | |
| 30 | ||
| 31 | return new ShopId($level->value >= self::HIGHER_SHOPS_FROM_LEVEL ? $shops[1] : $shops[0]); | |
| 32 | } | |
| 33 | } |