Esempio n. 1
0
File: Go.php Progetto: jaytaph/otas
 function execute(Adventure $adventure, Scene $scene, array $args)
 {
     if (count($args) <= 1) {
         $adventure->output("Where to?");
         return;
     }
     $direction = $args[1];
     if (!$scene->getExits()->containsKey($direction)) {
         $adventure->output('Cannot go ' . $direction);
         return;
     }
     $key = $scene->getExits()->get($direction);
     $newScene = $adventure->getScene($key);
     $adventure->getState()->setScene($newScene);
     list($action, $args) = $adventure->parse("look around");
     $action->execute($adventure, $adventure->getState()->getScene(), $args);
 }