Add Restriction Interface

This commit is contained in:
Michael Yoo 2013-11-26 21:32:08 +10:30
parent 3e12a41a91
commit c4ba06b58c

View File

@ -156,10 +156,17 @@ class PlayerPermissions implements ArrayAccess
//Thinking of doing $player->permissions[] = new EventRestriction("player.move"); //Thinking of doing $player->permissions[] = new EventRestriction("player.move");
//$player->permissions->apply(new EventRestriction("player.move")); //$player->permissions->apply(new EventRestriction("player.move"));
interface Restriction
{
public function __construct($restriction);
public function __toString();
}
/** /**
* Class EventRestriction * Class EventRestriction
*/ */
class EventRestriction class EventRestriction implements Restriction
{ {
/** /**
* @var string $event * @var string $event
@ -186,7 +193,7 @@ class EventRestriction
/** /**
* Class CommandRestriction * Class CommandRestriction
*/ */
class CommandRestriction class CommandRestriction implements Restriction
{ {
/** /**
* @var string $command * @var string $command