for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AardsGerds\Game\Build\Talent\WeaponMastery;
use AardsGerds\Game\Build\Talent\Talent;
use AardsGerds\Game\Build\Talent\TalentPoints;
use AardsGerds\Game\Inventory\Weapon\WeaponType;
use JetBrains\PhpStorm\Immutable;
#[Immutable]
final class WeaponMastery implements Talent
{
public function __construct(
private WeaponType $type,
private WeaponMasteryLevel $level,
) {}
public static function shortSword(WeaponMasteryLevel $level): self
return new self(WeaponType::shortSword(), $level);
}
public static function greatSword(WeaponMasteryLevel $level): self
return new self(WeaponType::greatSword(), $level);
public static function bow(WeaponMasteryLevel $level): self
return new self(WeaponType::bow(), $level);
public static function getName(): string
return 'Weapon Mastery';
public static function getDescription(): string
return 'Talent of weapon fighting.';
public static function getRequiredTalentPoints(): TalentPoints
return new TalentPoints(4);
public function getType(): WeaponType
return $this->type;
public function getLevel(): WeaponMasteryLevel
return $this->level;
public function __toString(): string
return "Mastery at {$this->type}: {$this->level}";