맵 규격 재 정의

This commit is contained in:
2018-07-12 01:00:24 +09:00
parent d774d8bbd0
commit fe4d370f60
49 changed files with 245 additions and 315 deletions
+17 -1
View File
@@ -189,7 +189,8 @@ class Scenario{
'statChiefMin'=>$this->data['stat']['chiefMin']??$default['stat']['chiefMin'],
];
$this->gameConf = array_merge($stat);
$this->gameConf = array_merge($stat, $this->data['map']??[]);
$this->iconPath = $this->data['iconPath']??$default['iconPath'];
return $this->gameConf;
}
@@ -363,6 +364,21 @@ class Scenario{
$this->gameConf,
true
);
$mapPath = __dir__.'/../scenario/map';
$unitPath = __dir__.'/../scenario/unit';
$mapName = $this->gameConf['mapName']??'che';
$unitSet = $this->gameConf['unitSet']??'che';
if(!file_exists("$mapPath/$mapName.php")){
throw new \RuntimeException('맵 파일이 올바르게 지정되지 않음! : '.$mapName);
}
if(!file_exists("$unitPath/$unitSet.php")){
throw new \RuntimeException('유닛 파일이 올바르게 지정되지 않음! : '.$unitSet);
}
copy("$mapPath/$mapName.php", $path.'/CityConst.php');
copy("$unitPath/$unitSet.php", $path.'/GameUnitConst.php');
}
public function build($env=[]){