Exemple #1
0
 /**
  * set the subject and extracts whether it can conversate
  *
  * @param Game\Conversation\AcceptConversation $subject
  * @return Game\Action\AbstractAction
  */
 public function setSubject(AcceptConversation $subject)
 {
     parent::setSubject($subject);
     $this->conversation = $this->subject->getConversation();
     if (empty($this->conversation)) {
         throw new Exception('Conversate action set but no conversation found in item ' . $this->subject->getName());
     }
 }
Exemple #2
0
 /**
  * adds an action to the action stack
  *
  * @see Game\Action.Action::addAction()
  * @return Game\Tile
  */
 public function addAction(AbstractAction $action)
 {
     $action->setSubject($this);
     $this->actions[$action->getName()] = $action;
     return $this;
 }
Exemple #3
0
 /**
  * adds an action to the action stack
  *
  * @see Game\Action.Action::addAction()
  * @return Game\Grid
  */
 public function addAction(AbstractAction $action)
 {
     $this->actions[$action->getName()] = $action;
     $action->setGrid($this);
     return $this;
 }
Exemple #4
0
 /**
  * Constructor
  *
  * @param Game\AbstractItemCombination $combination
  * @param Game\Grid $grid
  * @param Game\Inventory $inventory
  * @return void
  */
 public function __construct(AbstractItemCombination $combination, Grid $grid = null, Inventory $inventory = null)
 {
     parent::__construct($grid, $inventory);
     $this->combination = $combination;
 }