@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -interface ISuccessCalculator |
|
| 12 | -{ |
|
| 11 | +interface ISuccessCalculator { |
|
| 13 | 12 | public function hasHit(Character $character1, Character $character2, ?CharacterAttackSkill $skill = null): bool; |
| 14 | 13 | public function hasHealed(Character $healer): bool; |
| 15 | 14 | } |
@@ -10,8 +10,7 @@ |
||
| 10 | 10 | * |
| 11 | 11 | * @author Jakub Konečný |
| 12 | 12 | */ |
| 13 | -final class RandomSuccessCalculator implements ISuccessCalculator |
|
| 14 | -{ |
|
| 13 | +final class RandomSuccessCalculator implements ISuccessCalculator { |
|
| 15 | 14 | public const MAX_HIT_CHANCE = 100; |
| 16 | 15 | public const MIN_HIT_CHANCE = 15; |
| 17 | 16 | |
@@ -16,8 +16,7 @@ |
||
| 16 | 16 | * @property-read int $levels |
| 17 | 17 | * @property-read int $cooldown |
| 18 | 18 | */ |
| 19 | -abstract class BaseSkill |
|
| 20 | -{ |
|
| 19 | +abstract class BaseSkill { |
|
| 21 | 20 | use \Nette\SmartObject; |
| 22 | 21 | |
| 23 | 22 | protected int $id; |
@@ -8,10 +8,8 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -final class ConstantInitiativeFormulaParser implements IInitiativeFormulaParser |
|
| 12 | -{ |
|
| 13 | - public function __construct(private readonly int $initiative) |
|
| 14 | - { |
|
| 11 | +final class ConstantInitiativeFormulaParser implements IInitiativeFormulaParser { |
|
| 12 | + public function __construct(private readonly int $initiative) { |
|
| 15 | 13 | } |
| 16 | 14 | |
| 17 | 15 | public function calculateInitiative(Character $character): int |
@@ -11,10 +11,8 @@ |
||
| 11 | 11 | * @property-read int $damage |
| 12 | 12 | * @property-read int $hitRate |
| 13 | 13 | */ |
| 14 | -final class CharacterAttackSkill extends BaseCharacterSkill |
|
| 15 | -{ |
|
| 16 | - public function __construct(SkillAttack $skill, int $level) |
|
| 17 | - { |
|
| 14 | +final class CharacterAttackSkill extends BaseCharacterSkill { |
|
| 15 | + public function __construct(SkillAttack $skill, int $level) { |
|
| 18 | 16 | parent::__construct($skill, $level); |
| 19 | 17 | } |
| 20 | 18 | |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * @method void onApply(Character $character, CharacterEffect $effect) |
| 15 | 15 | * @method void onRemove(Character $character, CharacterEffect $effect) |
| 16 | 16 | */ |
| 17 | -class CharacterEffect |
|
| 18 | -{ |
|
| 17 | +class CharacterEffect { |
|
| 19 | 18 | use \Nette\SmartObject; |
| 20 | 19 | |
| 21 | 20 | public const DURATION_COMBAT = "combat"; |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | /** @var callable[] */ |
| 33 | 32 | public array $onRemove = []; |
| 34 | 33 | |
| 35 | - public function __construct(array $effect) |
|
| 36 | - { |
|
| 34 | + public function __construct(array $effect) { |
|
| 37 | 35 | $resolver = new OptionsResolver(); |
| 38 | 36 | $this->configureOptions($resolver); |
| 39 | 37 | $effect = $resolver->resolve($effect); |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * @property int $positionRow |
| 51 | 51 | * @property int $positionColumn |
| 52 | 52 | */ |
| 53 | -class Character |
|
| 54 | -{ |
|
| 53 | +class Character { |
|
| 55 | 54 | use \Nette\SmartObject; |
| 56 | 55 | |
| 57 | 56 | public const HITPOINTS_PER_CONSTITUTION = 5; |
@@ -10,15 +10,13 @@ |
||
| 10 | 10 | * |
| 11 | 11 | * @author Jakub Konečný |
| 12 | 12 | */ |
| 13 | -final class Pet implements ICharacterEffectsProvider |
|
| 14 | -{ |
|
| 13 | +final class Pet implements ICharacterEffectsProvider { |
|
| 15 | 14 | public readonly int $id; |
| 16 | 15 | public bool $deployed; |
| 17 | 16 | public readonly string $bonusStat; |
| 18 | 17 | public readonly int $bonusValue; |
| 19 | 18 | |
| 20 | - public function __construct(array $data) |
|
| 21 | - { |
|
| 19 | + public function __construct(array $data) { |
|
| 22 | 20 | $resolver = new OptionsResolver(); |
| 23 | 21 | $this->configureOptions($resolver); |
| 24 | 22 | $data = $resolver->resolve($data); |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | * @property int $maxRowSize |
| 16 | 16 | * @property-read int|null $rowToAttack |
| 17 | 17 | */ |
| 18 | -final class Team extends Collection |
|
| 19 | -{ |
|
| 18 | +final class Team extends Collection { |
|
| 20 | 19 | use \Nette\SmartObject; |
| 21 | 20 | |
| 22 | 21 | private const LOWEST_HP_THRESHOLD = 0.5; |
@@ -24,8 +23,7 @@ discard block |
||
| 24 | 23 | protected string $class = Character::class; |
| 25 | 24 | private int $maxRowSize = 5; |
| 26 | 25 | |
| 27 | - public function __construct(public readonly string $name) |
|
| 28 | - { |
|
| 26 | + public function __construct(public readonly string $name) { |
|
| 29 | 27 | parent::__construct(); |
| 30 | 28 | } |
| 31 | 29 | |