버그 수정

This commit is contained in:
2019-10-08 02:29:07 +09:00
parent b281362c98
commit 25837f6393
5 changed files with 32 additions and 23 deletions
+15 -5
View File
@@ -88,6 +88,13 @@ class che_강행 extends Command\GeneralCommand{
return 0;
}
public function getBrief():string{
$commandName = $this->getName();
$destCityName = CityConst::byID($this->arg['destCityID'])->name;
$josaRo = JosaUtil::pick($destCityName, '로');
return "{$destCityName}{$josaRo} {$commandName}";
}
public function getFailString():string{
$commandName = $this->getName();
$failReason = $this->testRunnable();
@@ -160,21 +167,24 @@ class che_강행 extends Command\GeneralCommand{
public function getForm(): string
{
$currentCityID = $this->generalObj->getCityID();
$form = [];
$form[] = \sammo\getMapHtml();
$currentCityName = CityConst::byID($currentCityID)->name;
$form[] = <<<EOT
선택된 도시로 강행합니다.<br>
최대 3칸내 도시로만 강행이 가능합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br>
<select class='formInput' name="destCityID" id="destCityID" size='1' style='color:white;background-color:black;'>
{$currentCityName} => <select class='formInput' name="destCityID" id="destCityID" size='1' style='color:white;background-color:black;'>
EOT;
$form[] = \sammo\optionsForCities();
$form[] = '</select>';
$form[] = '<input type=submit value="강행">';
$form[] = printCitiesBasedOnDistance($this->generalObj->getCityID(), 3);
$form[] = '</select> <input type=button id="commonSubmit" value="강행">';
$form[] = '';
$form[] = printCitiesBasedOnDistance($currentCityID, 3);
return join("\n",$form);
return join("<br>\n",$form);
}
+12 -12
View File
@@ -35,13 +35,13 @@ class che_건국 extends Command\GeneralCommand{
}
$nationName = $this->arg['nationName']??null;
$nationType = $this->arg['nationType']??null;
$nationColor = $this->arg['nationColor']??null;
$colorType = $this->arg['colorType']??null;
if($nationName === null || $nationType === null || $nationColor === null){
if($nationName === null || $nationType === null || $colorType === null){
return false;
}
if(!is_string($nationName) || !is_string($nationType) || !is_int($nationColor)){
if(!is_string($nationName) || !is_string($nationType) || !is_int($colorType)){
return false;
}
@@ -49,7 +49,7 @@ class che_건국 extends Command\GeneralCommand{
return false;
}
if(!key_exists($nationColor, GetNationColors())){
if(!key_exists($colorType, GetNationColors())){
return false;
}
@@ -63,7 +63,7 @@ class che_건국 extends Command\GeneralCommand{
$this->arg = [
'nationName'=>$nationName,
'nationType'=>$nationType,
'nationColor'=>$nationColor
'colorType'=>$colorType
];
return true;
@@ -76,7 +76,7 @@ class che_건국 extends Command\GeneralCommand{
$nationName = $this->arg['nationName'];
$nationType = $this->arg['nationType'];
$nationColor = $this->arg['nationColor'];
$colorType = $this->arg['colorType'];
$this->setCity();
$this->setNation(['gennum']);
@@ -84,11 +84,11 @@ class che_건국 extends Command\GeneralCommand{
$relYear = $env['year'] - $env['startyear'];
$this->runnableConstraints=[
ConstraintHelper::BeLord(),
ConstraintHelper::WanderingNation(),
ConstraintHelper::ReqNationValue('gennum', '수하 장수', '>=', 2),
ConstraintHelper::BeOpeningPart($relYear),
ConstraintHelper::WanderingNation(),
ConstraintHelper::CheckNationNameDuplicate($nationName),
ConstraintHelper::BeLord(),
ConstraintHelper::AllowJoinAction(),
ConstraintHelper::ConstructableCity(),
];
@@ -121,7 +121,7 @@ class che_건국 extends Command\GeneralCommand{
$nationName = $this->arg['nationName'];
$nationType = $this->arg['nationType'];
$nationColor = GetNationColors()[$this->arg['nationColor']];
$colorType = GetNationColors()[$this->arg['colorType']];
$cityName = $this->city['name'];
@@ -157,7 +157,7 @@ class che_건국 extends Command\GeneralCommand{
$db->update('nation', [
'name'=>$nationName,
'color'=>$nationColor,
'color'=>$colorType,
'level'=>1,
'type'=>$nationType,
'capital'=>$general->getCityID()
@@ -225,7 +225,7 @@ class che_건국 extends Command\GeneralCommand{
$form[] = <<<EOT
<br>
국명 : <input type='text' class='formInput' name="nationName" id="nationName" size='18' maxlength='18' style='color:white;background-color:black;'>
색깔 : <select class='formInput' name='nationColor' id='nationColor' size='1'>
색깔 : <select class='formInput' name='colorType' id='colorType' size='1'>
EOT;
foreach(GetNationColors() as $idx=>$color) {
/*
@@ -247,7 +247,7 @@ EOT;
}
$form[] = '</select>';
$form[] = '<input type="submit" value="건국">';
$form[] = '<input type=button id="commonSubmit" value="'.$this->getName().'">';
return join("\n",$form);
}