processWar 입출력 부근을 General Object로 변경

This commit is contained in:
2019-04-29 00:13:25 +09:00
parent c8422421ab
commit bbfe5c2ab0
7 changed files with 48 additions and 39 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ class che_출병 extends Command\GeneralCommand{
$general->applyDB($db);
//TODO: 장기적으로 통합해야함
processWar($general->getRaw(), $this->destCity);
processWar($general, $general->getStaticNation(), $this->destCity);
tryUniqueItemLottery($general);
$general->applyDB($db);
+2
View File
@@ -524,6 +524,8 @@ class General implements iAction{
return $caller;
}
//TODO:createGeneralObjListFromDB로, 조건으로 select query나 generalIDList가 들어가는 녀석이 필요할 수 있음
static public function createGeneralObjFromDB(int $generalID, ?array $column=null, int $constructMode=2):self{
$db = DB::db();
if($constructMode > 0){
+1 -1
View File
@@ -88,7 +88,7 @@ class WarUnitCity extends WarUnit{
return true;
}
function heavyDecreseWealth(){
function heavyDecreaseWealth(){
$this->multiplyVar('agri', 0.5);
$this->multiplyVar('comm', 0.5);
$this->multiplyVar('secu', 0.5);
+1 -1
View File
@@ -4,7 +4,7 @@ namespace sammo;
class WarUnitGeneral extends WarUnit{
protected $bonusPhase = 0;
function __construct(General $general, array $rawNation, bool $isAttacker, int $year, int $month){
function __construct(General $general, array $rawNation, bool $isAttacker){
$this->general = $general;
$this->raw = $general->getRaw();
$this->rawNation = $rawNation; //read-only