separate default attribute creation from Attribute into AttributeMap

This commit is contained in:
Dylan K. Taylor
2020-05-18 18:12:04 +01:00
parent 07f979fbde
commit 22425551ed
6 changed files with 72 additions and 44 deletions

View File

@ -153,12 +153,12 @@ abstract class Living extends Entity{
}
protected function addAttributes() : void{
$this->attributeMap->add(Attribute::get(Attribute::HEALTH));
$this->attributeMap->add(Attribute::get(Attribute::FOLLOW_RANGE));
$this->attributeMap->add(Attribute::get(Attribute::KNOCKBACK_RESISTANCE));
$this->attributeMap->add(Attribute::get(Attribute::MOVEMENT_SPEED));
$this->attributeMap->add(Attribute::get(Attribute::ATTACK_DAMAGE));
$this->attributeMap->add(Attribute::get(Attribute::ABSORPTION));
$this->attributeMap->add(AttributeFactory::getInstance()->get(Attribute::HEALTH));
$this->attributeMap->add(AttributeFactory::getInstance()->get(Attribute::FOLLOW_RANGE));
$this->attributeMap->add(AttributeFactory::getInstance()->get(Attribute::KNOCKBACK_RESISTANCE));
$this->attributeMap->add(AttributeFactory::getInstance()->get(Attribute::MOVEMENT_SPEED));
$this->attributeMap->add(AttributeFactory::getInstance()->get(Attribute::ATTACK_DAMAGE));
$this->attributeMap->add(AttributeFactory::getInstance()->get(Attribute::ABSORPTION));
}
public function setHealth(float $amount) : void{