2017-03-30 19:02:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
|
|
|
|
|
|
|
|
|
|
|
use ManiaControl\ManiaControl;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Structure Class for the OnHit Structure Callback
|
|
|
|
*
|
2017-04-07 23:26:35 +02:00
|
|
|
* @api
|
2017-03-30 19:02:18 +02:00
|
|
|
* @author ManiaControl Team <mail@maniacontrol.com>
|
2019-01-05 21:02:24 +01:00
|
|
|
* @copyright 2014-2019 ManiaControl Team
|
2017-03-30 19:02:18 +02:00
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
|
|
|
*/
|
|
|
|
class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure {
|
|
|
|
private $damage;
|
2017-04-13 16:12:10 +02:00
|
|
|
private $shooterPoints;
|
2017-03-30 19:02:18 +02:00
|
|
|
|
2017-04-07 23:26:35 +02:00
|
|
|
/**
|
|
|
|
* OnHitStructure constructor.
|
|
|
|
*
|
|
|
|
* @param \ManiaControl\ManiaControl $maniaControl
|
|
|
|
* @param array $data
|
|
|
|
*/
|
2017-03-30 19:02:18 +02:00
|
|
|
public function __construct(ManiaControl $maniaControl, array $data) {
|
|
|
|
parent::__construct($maniaControl, $data);
|
|
|
|
|
2017-04-13 16:12:10 +02:00
|
|
|
$this->damage = $this->getPlainJsonObject()->damage;
|
|
|
|
$this->shooterPoints = $this->getPlainJsonObject()->points;
|
2017-03-30 19:02:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* < Amount of Damage done by the hit (only on onHit)
|
|
|
|
*
|
2017-04-07 23:26:35 +02:00
|
|
|
* @api
|
2017-03-30 19:02:18 +02:00
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getDamage() {
|
|
|
|
return $this->damage;
|
|
|
|
}
|
2017-04-13 16:12:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Amount of points scored by the shooter
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getShooterPoints() {
|
|
|
|
return $this->shooterPoints;
|
|
|
|
}
|
|
|
|
|
2017-03-30 19:02:18 +02:00
|
|
|
}
|