Effect: use promoted properties

This commit is contained in:
Dylan K. Taylor 2021-09-03 20:32:13 +01:00
parent 078347b44a
commit 8e58beef7f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -29,31 +29,20 @@ use pocketmine\entity\Living;
class Effect{
/** @var int */
protected $internalRuntimeId;
/** @var string */
protected $name;
/** @var Color */
protected $color;
/** @var bool */
protected $bad;
/** @var bool */
protected $hasBubbles;
/**
* @param int $internalRuntimeId Internal runtime ID, unique to this effect type. Used for comparisons.
* @param string $name Translation key used for effect name
* @param Color $color Color of bubbles given by this effect
* @param bool $isBad Whether the effect is harmful
* @param bool $bad Whether the effect is harmful
* @param bool $hasBubbles Whether the effect has potion bubbles. Some do not (e.g. Instant Damage has its own particles instead of bubbles)
*/
public function __construct(int $internalRuntimeId, string $name, Color $color, bool $isBad = false, bool $hasBubbles = true){
$this->internalRuntimeId = $internalRuntimeId;
$this->name = $name;
$this->color = $color;
$this->bad = $isBad;
$this->hasBubbles = $hasBubbles;
}
public function __construct(
protected int $internalRuntimeId,
protected string $name,
protected Color $color,
protected bool $bad = false,
protected bool $hasBubbles = true
){}
/**
* Returns a unique identifier for this effect type