general_pool 에서 장수 선택 기능 추가

This commit is contained in:
2020-12-31 07:43:56 +09:00
parent 187db3d011
commit 3e35dec9fa
66 changed files with 5597 additions and 1319 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace sammo\GeneralPool;
use sammo\AbsFromUserPool;
use sammo\GameConst;
use sammo\Json;
use sammo\Util;
class SPoolUnderU30 extends AbsFromUserPool{
public static function getPoolName():string{return "체30기 이벤트";}
public static function initPool(\MeekroDB $db){
$jsonData=Json::decode(file_get_contents(__DIR__."/Pool/UnderS30.json"));
$columns = $jsonData['columns'];
$sqlValues = [];
foreach($jsonData['data'] as $rawItem){
if(count($rawItem) != count($columns)){
throw new \RuntimeException($rawItem[0]."Error");
}
$item = array_combine($columns, $rawItem);
$uniqueName = $item['generalName'];
$item['uniqueName'] = $uniqueName;
$sqlValues[] = [
'unique_name'=>$uniqueName,
'info'=>Json::encode($item)
];
}
$db->insert('select_pool', $sqlValues);
}
}