GameConst에 mapName과 unitSet추가

This commit is contained in:
2018-07-12 01:59:32 +09:00
parent b6cd004117
commit d75aa7e8dc
2 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -358,12 +358,13 @@ class Scenario{
public function buildConf(){
$path = __dir__.'/../d_setting';
Util::generatePHPClassFile($path.'/GameConst.php', $this->gameConf, 'GameConstBase', 'sammo');
$mapPath = __dir__.'/../scenario/map';
$unitPath = __dir__.'/../scenario/unit';
$mapName = $this->gameConf['mapName']??'che';
$unitSet = $this->gameConf['unitSet']??'che';
$this->gameConf['mapName'] = $mapName;
$this->gameConf['unitSet'] = $unitSet;
if(!file_exists("$mapPath/$mapName.php")){
throw new \RuntimeException('맵 파일이 올바르게 지정되지 않음! : '.$mapName);
@@ -372,6 +373,8 @@ class Scenario{
throw new \RuntimeException('유닛 파일이 올바르게 지정되지 않음! : '.$unitSet);
}
Util::generatePHPClassFile($path.'/GameConst.php', $this->gameConf, 'GameConstBase', 'sammo');
copy("$mapPath/$mapName.php", $path.'/CityConst.php');
copy("$unitPath/$unitSet.php", $path.'/GameUnitConst.php');
}