1 | <?php |
||
15 | class ActionFactory implements ListenerInterfaceMpLegacyManialink |
||
16 | { |
||
17 | protected $class; |
||
18 | |||
19 | /** @var Action[] */ |
||
20 | protected $actions = []; |
||
21 | |||
22 | /** @var Action[][] */ |
||
23 | protected $actionsByManialink = []; |
||
24 | |||
25 | /** @var ManialinkInterface[] */ |
||
26 | protected $manialinkByAction = []; |
||
27 | |||
28 | /** |
||
29 | * ActionFactory constructor. |
||
30 | * @param $class |
||
31 | */ |
||
32 | 7 | public function __construct($class) |
|
36 | |||
37 | |||
38 | /** |
||
39 | * Create a Manialink action for a manialink. |
||
40 | * |
||
41 | * @param ManialinkInterface $manialink |
||
42 | * @param $callable |
||
43 | * @param array $args |
||
44 | * @param boolean $permanent |
||
45 | * |
||
46 | * @return string action Id |
||
47 | */ |
||
48 | 7 | public function createManialinkAction(ManialinkInterface $manialink, $callable, $args, $permanent = false) |
|
59 | |||
60 | /** |
||
61 | * Destroy all actions for a manialink. |
||
62 | * |
||
63 | * @param ManialinkInterface $manialink |
||
64 | */ |
||
65 | 1 | public function destroyManialinkActions(ManialinkInterface $manialink) |
|
76 | |||
77 | /** |
||
78 | * Destroy actions that are not permanent actions. |
||
79 | * |
||
80 | * @param ManialinkInterface $manialink |
||
81 | */ |
||
82 | public function destroyNotPermanentActions(ManialinkInterface $manialink) |
||
92 | |||
93 | |||
94 | /** |
||
95 | * Destroy an individual action. |
||
96 | * |
||
97 | * @param $actionId |
||
98 | */ |
||
99 | 3 | public function destroyAction($actionId) |
|
106 | |||
107 | /** |
||
108 | * When a player uses an action dispatch information. |
||
109 | * |
||
110 | * @param $login |
||
111 | * @param $actionId |
||
112 | * @param array $entryValues |
||
113 | * |
||
114 | */ |
||
115 | 2 | public function onPlayerManialinkPageAnswer($login, $actionId, array $entryValues) |
|
121 | } |
||
122 |