/** * Set new Action based on what has been chosen * @param $data array */ public function chooseAction($data) { /** @var $action ActionDetails */ $action = $data['action']; $nA = new Action($action); $nA->setActionDie($this->getCurrentAction()->getActionDie()); $this->setCurrentAction($nA); }
/** * Adds a decision to the bottom of the stack * @param Action $d * @return Action */ public function addToBottom(Action $d) { $pos = $this->getPositions(); if (count($pos) == 0) { $bottomPos = 0; } else { $bottomPos = max($pos); } $d->setPosition($bottomPos + 1); $d->setStack($this); return $d; }