callback implementation
This commit is contained in:
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Lukas
|
||||
* Date: 25. Mär. 2017
|
||||
* Time: 11:37
|
||||
*/
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania\Models;
|
||||
|
||||
|
@ -1,14 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Lukas
|
||||
* Date: 25. Mär. 2017
|
||||
* Time: 12:44
|
||||
*/
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania\Models;
|
||||
|
||||
|
||||
//TODO describtion
|
||||
class PlayerScore {
|
||||
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania\Models;
|
||||
|
||||
|
||||
//TODO describtion
|
||||
class Position {
|
||||
private $x = 0;
|
||||
private $y = 0;
|
||||
|
@ -1,14 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Lukas
|
||||
* Date: 25. Mär. 2017
|
||||
* Time: 12:43
|
||||
*/
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania\Models;
|
||||
|
||||
|
||||
//TODO describtion
|
||||
class TeamScore {
|
||||
private $id;
|
||||
private $name;
|
||||
|
17
core/Callbacks/Structures/ShootMania/Models/Weapons.php
Normal file
17
core/Callbacks/Structures/ShootMania/Models/Weapons.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania\Models;
|
||||
|
||||
/**
|
||||
* Weapons Interface
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
interface Weapons {
|
||||
const LASER = 1;
|
||||
const ROCKET = 2;
|
||||
const NUCLEUS = 3;
|
||||
const ARROW = 5;
|
||||
}
|
57
core/Callbacks/Structures/ShootMania/OnCommandStructure.php
Normal file
57
core/Callbacks/Structures/ShootMania/OnCommandStructure.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
||||
|
||||
|
||||
use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
/**
|
||||
* Structure Class for the OnCommand Structure Callback
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class OnCommandStructure extends BaseStructure {
|
||||
public $time;
|
||||
public $name;
|
||||
public $value;
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
|
||||
$this->time = $this->getPlainJsonObject()->time;
|
||||
$this->name = $this->getPlainJsonObject()->name;
|
||||
$this->value = $this->getPlainJsonObject()->value;
|
||||
}
|
||||
|
||||
/** Dumps the Object with some Information */
|
||||
public function dump() {
|
||||
parent::dump();
|
||||
var_dump("With getShooter() you get a Player Object");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime() {
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \ManiaControl\Players\Player
|
||||
*/
|
||||
public function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Lukas
|
||||
* Date: 25. Mär. 2017
|
||||
* Time: 19:53
|
||||
*/
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
||||
|
||||
|
||||
class OnCustomEventStructure {
|
||||
|
||||
}
|
@ -13,7 +13,7 @@ use ManiaControl\ManiaControl;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class DefaultEventStructure extends BaseStructure {
|
||||
class OnDefaultEventStructure extends BaseStructure {
|
||||
public $time;
|
||||
public $type;
|
||||
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
||||
|
||||
|
||||
use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
/**
|
||||
* Structure Class for the OnFallDamage Structure Callback
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class OnFallDamageStructure extends BaseStructure {
|
||||
public $time;
|
||||
/**
|
||||
* @var Player $shooter
|
||||
*/
|
||||
private $victim;
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
|
||||
$this->time = $this->getPlainJsonObject()->time;
|
||||
$this->victim = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->victim);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime() {
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player
|
||||
*/
|
||||
public function getVictim() {
|
||||
return $this->victim;
|
||||
}
|
||||
|
||||
/** Dumps the Object with some Information */
|
||||
public function dump() {
|
||||
parent::dump();
|
||||
var_dump("With getVictim() you get a Player Object");
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
||||
|
||||
|
||||
use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
/**
|
||||
* Structure Class for the OnPlayerRequestRespawnStructure Structure Callback
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class OnPlayerRequestRespawnStructure extends BaseStructure {
|
||||
public $time;
|
||||
/**
|
||||
* @var Player $shooter
|
||||
*/
|
||||
private $player;
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
|
||||
$this->time = $this->getPlainJsonObject()->time;
|
||||
$this->player = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->victim);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime() {
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player
|
||||
*/
|
||||
public function getPlayer() {
|
||||
return $this->player;
|
||||
}
|
||||
|
||||
/** Dumps the Object with some Information */
|
||||
public function dump() {
|
||||
parent::dump();
|
||||
var_dump("With getPlayer() you get a Player Object");
|
||||
}
|
||||
}
|
@ -7,6 +7,13 @@ use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
/**
|
||||
* Structure Class for the OnShoot Structure Callback
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class OnShootStructure extends BaseStructure {
|
||||
public $time;
|
||||
public $weapon;
|
||||
@ -15,7 +22,6 @@ class OnShootStructure extends BaseStructure {
|
||||
*/
|
||||
private $shooter;
|
||||
|
||||
//TODO test
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
|
||||
|
88
core/Callbacks/Structures/ShootMania/OnShotDenyStructure.php
Normal file
88
core/Callbacks/Structures/ShootMania/OnShotDenyStructure.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\ShootMania;
|
||||
|
||||
|
||||
use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
|
||||
/**
|
||||
* Structure Class for the OnShotDeny Structure Callback
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class OnShotDenyStructure extends BaseStructure {
|
||||
public $time;
|
||||
public $shooterWeapon;
|
||||
public $victimWeapon;
|
||||
|
||||
protected $shooter;
|
||||
protected $victim;
|
||||
|
||||
/**
|
||||
* Construct a new On Hit Structure
|
||||
*
|
||||
* @param ManiaControl $maniaControl
|
||||
* @param array $data
|
||||
*/
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
|
||||
$jsonObj = $this->getPlainJsonObject();
|
||||
$this->time = $jsonObj->time;
|
||||
$this->shooterWeapon = $jsonObj->victim;
|
||||
$this->victimWeapon = $jsonObj->damage;
|
||||
|
||||
$this->shooter = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->shooter);
|
||||
$this->victim = $this->maniaControl->getPlayerManager()->getPlayer($this->getPlainJsonObject()->victim);
|
||||
}
|
||||
|
||||
/** Dumps the Object with some Information */
|
||||
public function dump() {
|
||||
parent::dump();
|
||||
var_dump("With getShooter() you get a Player Object");
|
||||
var_dump("With getVictim() you get a Player Object");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime() {
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Player
|
||||
*/
|
||||
public function getShooter() {
|
||||
return $this->shooter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player
|
||||
*/
|
||||
public function getVictim() {
|
||||
return $this->victim;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getShooterWeapon() {
|
||||
return $this->shooterWeapon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getVictimWeapon() {
|
||||
return $this->victimWeapon;
|
||||
}
|
||||
|
||||
|
||||
}
|
57
core/Callbacks/Structures/TrackMania/OnCommandStructure.php
Normal file
57
core/Callbacks/Structures/TrackMania/OnCommandStructure.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\TrackMania;
|
||||
|
||||
|
||||
use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
use ManiaControl\ManiaControl;
|
||||
|
||||
/**
|
||||
* Structure Class for the OnCommand Structure Callback
|
||||
*
|
||||
* @author ManiaControl Team <mail@maniacontrol.com>
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class OnCommandStructure extends BaseStructure {
|
||||
public $time;
|
||||
public $name;
|
||||
public $value;
|
||||
|
||||
public function __construct(ManiaControl $maniaControl, $data) {
|
||||
parent::__construct($maniaControl, $data);
|
||||
|
||||
$this->time = $this->getPlainJsonObject()->time;
|
||||
$this->name = $this->getPlainJsonObject()->name;
|
||||
$this->value = $this->getPlainJsonObject()->value;
|
||||
}
|
||||
|
||||
/** Dumps the Object with some Information */
|
||||
public function dump() {
|
||||
parent::dump();
|
||||
var_dump("With getShooter() you get a Player Object");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTime() {
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \ManiaControl\Players\Player
|
||||
*/
|
||||
public function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace ManiaControl\Callbacks\Structures\Trackmania;
|
||||
namespace ManiaControl\Callbacks\Structures\TrackMania;
|
||||
|
||||
|
||||
use ManiaControl\Callbacks\Structures\BaseStructure;
|
||||
@ -13,7 +13,7 @@ use ManiaControl\ManiaControl;
|
||||
* @copyright 2014-2017 ManiaControl Team
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class DefaultEventStructure extends BaseStructure {
|
||||
class OnDefaultEventStructure extends BaseStructure {
|
||||
public $time;
|
||||
public $type;
|
||||
|
Reference in New Issue
Block a user