커스텀 맵 준비
This commit is contained in:
@@ -188,6 +188,7 @@ class ResetHelper{
|
||||
'startyear'=>$startyear,
|
||||
'year'=> $year,
|
||||
'month'=> $month,
|
||||
'map_theme' => $scenarioObj->getMapTheme(),
|
||||
'msg'=>'공지사항',//TODO:공지사항
|
||||
'maxgeneral'=>GameConst::$defaultMaxGeneral,
|
||||
'maxnation'=>GameConst::$defaultMaxNation,
|
||||
@@ -225,6 +226,7 @@ class ResetHelper{
|
||||
'server_id'=>$serverID,
|
||||
'date'=>$turntime,
|
||||
'winner_nation'=>null,
|
||||
'map_theme'=>$scenarioObj->getMapTheme(),
|
||||
'scenario'=>$scenario,
|
||||
'scenario_name'=>$scenarioObj->getTitle(),
|
||||
'env'=>Json::encode($env)
|
||||
|
||||
+16
-4
@@ -192,6 +192,10 @@ class Scenario{
|
||||
$this->gameConf = array_merge($stat, $this->data['map']??[], $this->data['const']??[]);
|
||||
|
||||
$this->iconPath = $this->data['iconPath']??$default['iconPath'];
|
||||
|
||||
$this->gameConf['mapName'] = $this->gameConf['mapName']??'che';
|
||||
$this->gameConf['unitSet'] = $this->gameConf['unitSet']??'che';
|
||||
|
||||
return $this->gameConf;
|
||||
}
|
||||
|
||||
@@ -247,6 +251,14 @@ class Scenario{
|
||||
$this->initFull();
|
||||
return $this->nations;
|
||||
}
|
||||
|
||||
public function getMapTheme(){
|
||||
return $this->gameConf['mapName'];
|
||||
}
|
||||
|
||||
public function getUnitSet(){
|
||||
return $this->gameConf['unitSet'];
|
||||
}
|
||||
|
||||
public function getScenarioBrief(){
|
||||
$this->initFull();
|
||||
@@ -361,10 +373,10 @@ class Scenario{
|
||||
|
||||
$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;
|
||||
|
||||
$mapName = $this->gameConf['mapName'];
|
||||
$unitSet = $this->gameConf['unitSet'];
|
||||
|
||||
|
||||
if(!file_exists("$mapPath/$mapName.php")){
|
||||
throw new \RuntimeException('맵 파일이 올바르게 지정되지 않음! : '.$mapName);
|
||||
|
||||
Reference in New Issue
Block a user