fix: 진행 중 $rng 호출 관련 버그 수정

This commit is contained in:
2022-05-17 23:28:31 +09:00
parent 8665838472
commit b22987f21b
5 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -447,7 +447,7 @@ class TurnExecutionHelper
updateQuaterly();
disaster($monthlyRng);
tradeRate($monthlyRng);
addAge();
addAge($monthlyRng);
// 새해 알림
$logger->pushGlobalActionLog("<C>{$gameStor->year}</>년이 되었습니다.");
$logger->flush(); //TODO: globalAction류는 전역에서 관리하는것이 좋을 듯.
+1 -3
View File
@@ -4,8 +4,6 @@ namespace sammo;
class WarUnit
{
public readonly RandUtil $rng;
protected $general;
protected $rawNation;
@@ -34,7 +32,7 @@ class WarUnit
protected $logActivatedSkill = [];
protected $isFinished = false;
private function __construct(RandUtil $rng, General $general)
private function __construct(public readonly RandUtil $rng, General $general)
{
$this->rng = $rng;
$this->general = $general;
+1 -2
View File
@@ -8,8 +8,7 @@ class WarUnitCity extends WarUnit{
protected $cityRate;
function __construct(RandUtil $rng, $raw, $rawNation, int $year, int $month, $cityRate){
$this->rng = $rng;
function __construct(public readonly RandUtil $rng, $raw, $rawNation, int $year, int $month, $cityRate){
$general = new DummyGeneral(false);
$general->setVar('city', $raw['city']);
$general->setVar('nation', $raw['nation']);
+1 -2
View File
@@ -10,9 +10,8 @@ class WarUnitGeneral extends WarUnit
protected $killedPerson = 0;
protected $deadPerson = 0;
function __construct(RandUtil $rng, General $general, array $rawNation, bool $isAttacker)
function __construct(public readonly RandUtil $rng, General $general, array $rawNation, bool $isAttacker)
{
$this->rng = $rng;
$this->general = $general;
$this->raw = $general->getRaw();
$this->rawNation = $rawNation; //read-only