mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
Added : void typehint to SkinAdapterSingleton & provide documentation
This commit is contained in:
parent
f682c16740
commit
01d6cbe9c3
@ -25,9 +25,24 @@ namespace pocketmine\network\mcpe\protocol\types;
|
|||||||
|
|
||||||
use pocketmine\entity\Skin;
|
use pocketmine\entity\Skin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to convert new skin data to the skin entity or old skin entity to skin data.
|
||||||
|
*/
|
||||||
interface SkinAdapter{
|
interface SkinAdapter{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to convert a skin entity to skin data.
|
||||||
|
*
|
||||||
|
* @param Skin $skin
|
||||||
|
* @return SkinData
|
||||||
|
*/
|
||||||
public function toSkinData(Skin $skin) : SkinData;
|
public function toSkinData(Skin $skin) : SkinData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to convert skin data to a skin entity.
|
||||||
|
*
|
||||||
|
* @param SkinData $data
|
||||||
|
* @return Skin
|
||||||
|
*/
|
||||||
public function fromSkinData(SkinData $data) : Skin;
|
public function fromSkinData(SkinData $data) : Skin;
|
||||||
}
|
}
|
@ -23,8 +23,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\network\mcpe\protocol\types;
|
namespace pocketmine\network\mcpe\protocol\types;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accessor for SkinAdapter
|
||||||
|
*/
|
||||||
class SkinAdapterSingleton{
|
class SkinAdapterSingleton{
|
||||||
|
/** @var SkinAdapter|null */
|
||||||
private static $skinAdapter = null;
|
private static $skinAdapter = null;
|
||||||
|
|
||||||
public static function get() : SkinAdapter{
|
public static function get() : SkinAdapter{
|
||||||
@ -34,7 +37,7 @@ class SkinAdapterSingleton{
|
|||||||
return self::$skinAdapter;
|
return self::$skinAdapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function set(SkinAdapter $adapter){
|
public static function set(SkinAdapter $adapter) : void{
|
||||||
self::$skinAdapter = $adapter;
|
self::$skinAdapter = $adapter;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user