Entity: Require declaration of gravity and drag via abstract methods

this guarantees that subclasses will actually declare them.

[bc break]
This commit is contained in:
Dylan K. Taylor
2022-06-01 20:51:18 +01:00
parent f3c9b59856
commit b7e2b3e94a
11 changed files with 52 additions and 30 deletions

View File

@ -41,9 +41,6 @@ class PrimedTNT extends Entity implements Explosive{
public static function getNetworkTypeId() : string{ return EntityIds::TNT; }
protected $gravity = 0.04;
protected $drag = 0.02;
/** @var int */
protected $fuse;
@ -53,6 +50,10 @@ class PrimedTNT extends Entity implements Explosive{
protected function getInitialSizeInfo() : EntitySizeInfo{ return new EntitySizeInfo(0.98, 0.98); }
protected function getInitialDragMultiplier() : float{ return 0.02; }
protected function getInitialGravity() : float{ return 0.04; }
public function getFuse() : int{
return $this->fuse;
}