added bind and unbind functions & added the simple ExampleBot. (doesn't run right...
[PHP-P10.git] / ModCMD / Binding.class.php
index dfb247ffb7d4731626c9ce9b76cf5995b4967209..143b35ef2487e1c203a41b29a68ed2fe1f96bba6 100644 (file)
  */
 
 class Binding {
+       private $bot;
+       private $method;
        
-       public function trigger() {
-               
+       public function __construct($bot, $method) {
+               $this->bot = $bot;
+               $this->method = $method;
+       }
+       
+       public function trigger($params) {
+               call_user_func_array(array($this->bot, $this->method), $params);
+       }
+       
+       public function match($bot, $method) {
+               return ($bot === $this->bot && strtolower($this->method) == strtolower($method));
        }
        
 }