턴 커맨드에 getPreReqTurn, getPostReqTurn 추가

This commit is contained in:
2018-10-03 17:45:47 +09:00
parent 1d0bcd857e
commit a33a7317cc
6 changed files with 70 additions and 10 deletions
+4 -1
View File
@@ -37,9 +37,9 @@ abstract class BaseCommand{
protected $runnableConstraints = null;
protected $reservableConstraints = null;
protected $logger;
public function __construct(General $generalObj, array $env, $arg = null){
@@ -194,6 +194,9 @@ abstract class BaseCommand{
abstract public function getCost():array;
abstract public function getPreReqTurn():int;
abstract public function getPostReqTurn():int;
abstract public function run():bool;
@@ -30,14 +30,15 @@ class che_기술연구 extends che_상업투자{
$this->setCity();
$this->setNation();
$develCost = $this->env['develcost'];
$reqGold = $general->onCalcDomestic(static::$actionKey, 'cost', $reqGold);
[$reqGold, $reqRice] = $this->getCost();
$this->runnableConstraints=[
['NoNeutral'],
['NoWanderingNation'],
['OccupiedCity'],
['SuppliedCity'],
['ReqGeneralGold', $reqGold],
['ReqGeneralRice', $reqRice],
['ReqGeneralGold', $reqGold]
];
+18 -2
View File
@@ -32,8 +32,7 @@ class che_상업투자 extends Command\GeneralCommand{
$this->setCity();
$this->setNation();
$develCost = $this->env['develcost'];
$reqGold = $general->onCalcDomestic(static::$actionKey, 'cost', $reqGold);
[$reqGold, $reqRice] = $this->getCost();
$this->runnableConstraints=[
['NoNeutral'],
@@ -41,6 +40,7 @@ class che_상업투자 extends Command\GeneralCommand{
['OccupiedCity'],
['SuppliedCity'],
['ReqGeneralGold', $reqGold],
['ReqGeneralRice', $reqRice],
['RemainCityCapacity', [static::$cityKey, static::$actionName]]
];
@@ -51,6 +51,22 @@ class che_상업투자 extends Command\GeneralCommand{
return true;
}
public function getCost():array{
$develCost = $this->env['develcost'];
$reqGold = $general->onCalcDomestic(static::$actionKey, 'cost', $develCost);
$reqRice = 0;
return [$reqGold, $reqRice];
}
public function getPreReqTurn():int{
return 0;
}
public function getPostReqTurn():int{
return 0;
}
protected function calcBaseScore():float{
$trust = Util::valueFit($this->city['trust'], 50);
$general = $this->generalObj;
+19 -3
View File
@@ -31,15 +31,15 @@ class che_정착장려 extends Command\GeneralCommand{
$this->setCity();
$this->setNation();
$develCost = $this->env['develcost'] * 2;
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $reqRice);
[$reqGold, $reqRice] = $this->getCost();
$this->runnableConstraints=[
['NoNeutral'],
['NoWanderingNation'],
['OccupiedCity'],
['SuppliedCity'],
['ReqGeneralGold', $reqRice],
['ReqGeneralGold', $reqGold],
['ReqGeneralRice', $reqRice],
['RemainCityCapacity', [static::$cityKey, static::$actionName]]
];
@@ -50,6 +50,22 @@ class che_정착장려 extends Command\GeneralCommand{
return true;
}
public function getCost():array{
$develCost = $this->env['develcost'] * 2;
$reqGold = 0;
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $develCost);
return [$reqGold, $reqRice];
}
public function getPreReqTurn():int{
return 0;
}
public function getPostReqTurn():int{
return 0;
}
protected function calcBaseScore():float{
$general = $this->generalObj;
+18 -2
View File
@@ -31,14 +31,14 @@ class che_주민선정 extends Command\GeneralCommand{
$this->setCity();
$this->setNation();
$develCost = $this->env['develcost'] * 2;
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $reqGold);
[$reqGold, $reqRice] = $this->getCost();
$this->runnableConstraints=[
['NoNeutral'],
['NoWanderingNation'],
['OccupiedCity'],
['SuppliedCity'],
['ReqGeneralGold', $reqGold],
['ReqGeneralRice', $reqRice],
['RemainCityTrust', static::$actionName]
];
@@ -50,6 +50,22 @@ class che_주민선정 extends Command\GeneralCommand{
return true;
}
public function getCost():array{
$develCost = $this->env['develcost'] * 2;
$reqGold = 0;
$reqRice = $general->onCalcDomestic(static::$actionKey, 'cost', $develCost);
return [$reqGold, $reqRice];
}
public function getPreReqTurn():int{
return 0;
}
public function getPostReqTurn():int{
return 0;
}
protected function calcBaseScore():float{
$general = $this->generalObj;
+8
View File
@@ -18,6 +18,14 @@ class 휴식 extends GeneralCommand{
return [0, 0];
}
public function getPreReqTurn():int{
return 0;
}
public function getPostReqTurn():int{
return 0;
}
public function run():bool{
$general = $this->generalObj;
$logger = $general->getLogger();