fix: RegNPC 버그 수정, event handler 규격 버그 수정
This commit is contained in:
@@ -3,7 +3,7 @@ namespace sammo\Event;
|
||||
|
||||
abstract class Action{
|
||||
//public abstract function __construct(...$args);
|
||||
public abstract function run($env=null);
|
||||
public abstract function run($env);
|
||||
|
||||
public static function build($actionArgs):Action{
|
||||
if(!is_array($actionArgs)){
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace sammo\Event\Action;
|
||||
|
||||
//이전 RegNPC 함수를 EventAction으로 재구성
|
||||
class RegNPC extends \sammo\Event\Action{
|
||||
/** @var \sammo\Scenario\GeneralBuilder */
|
||||
private $npc;
|
||||
|
||||
public function __construct(
|
||||
@@ -22,7 +23,7 @@ class RegNPC extends \sammo\Event\Action{
|
||||
$text = ''
|
||||
){
|
||||
|
||||
return (new \sammo\Scenario\GeneralBuilder(
|
||||
$this->npc=(new \sammo\Scenario\GeneralBuilder(
|
||||
$name,
|
||||
0,
|
||||
$picturePath,
|
||||
@@ -38,7 +39,7 @@ class RegNPC extends \sammo\Event\Action{
|
||||
->setLifeSpan($birth, $death);
|
||||
}
|
||||
|
||||
public function run($env=null){
|
||||
public function run($env){
|
||||
$result = $this->npc->fillRemainSpecAsZero($env)->build($env);
|
||||
return [__CLASS__, $result];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class RegNeutralNPC extends \sammo\Event\Action{
|
||||
$char = '',
|
||||
$text = ''
|
||||
){
|
||||
return (new \sammo\Scenario\GeneralBuilder(
|
||||
$this->npc=(new \sammo\Scenario\GeneralBuilder(
|
||||
$name,
|
||||
0,
|
||||
$picturePath,
|
||||
|
||||
@@ -14,7 +14,7 @@ class EventHandler{
|
||||
|
||||
}
|
||||
|
||||
public function tryRunEvent(array $env=null){
|
||||
public function tryRunEvent(array $env){
|
||||
$result = $this->condition->eval($env);
|
||||
|
||||
if(!$result['value']){
|
||||
|
||||
Reference in New Issue
Block a user