buildGeneralCommandClass류 구현

This commit is contained in:
2018-10-06 04:08:43 +09:00
parent b94081c45b
commit 1660e563ab
4 changed files with 15 additions and 11 deletions
+2 -4
View File
@@ -5,8 +5,7 @@ function getGeneralTurnBrief(General $generalObj, array $turnList) {
$result = [];
foreach($turnList as $turnIdx => [$action, $arg]){
$commandClass = getGeneralCommandClass($action);
$commandObj = new $commandClass($generalObj, [], $arg);
$commandObj = buildGeneralCommandClass($action, $generalObj, [], $arg);
$turnText = $commandObj->getBrief();
$result[$turnIdx] = $turnText;
}
@@ -18,8 +17,7 @@ function getNationTurnBrief(General $generalObj, array $turnList) {
$tmpTurn = new LastTurn();
foreach($turnList as $turnIdx => [$action, $arg]){
$commandClass = getNationCommandClass($action);
$commandObj = new $commandClass($generalObj, [], $tmpTurn, $arg);
$commandObj = buildNationCommandClass($action, $generalObj, [], $tmpTurn, $arg);
$turnText = $commandObj->getBrief();
$result[$turnIdx] = $turnText;
}