refac: RankColumn enum 추가, General의 명장 일람 타입 변경

This commit is contained in:
2022-05-08 23:09:27 +09:00
parent 55012fef95
commit 900235885f
16 changed files with 236 additions and 154 deletions
+10 -8
View File
@@ -2,6 +2,8 @@
namespace sammo;
use sammo\Enums\RankColumn;
class WarUnitGeneral extends WarUnit
{
protected $raw;
@@ -52,7 +54,7 @@ class WarUnitGeneral extends WarUnit
{
parent::setOppose($oppose);
$general = $this->general;
$this->general->increaseRankVar('warnum', 1);
$this->general->increaseRankVar(RankColumn::warnum, 1);
if ($this->isAttacker) {
$semiTurn = $general->getTurnTime();
@@ -152,11 +154,11 @@ class WarUnitGeneral extends WarUnit
function addWin()
{
$general = $this->general;
$general->increaseRankVar('killnum', 1);
$general->increaseRankVar(RankColumn::killnum, 1);
$oppose = $this->getOppose();
if ($oppose instanceof WarUnitCity) {
$general->increaseRankVar('occupied', 1);
$general->increaseRankVar(RankColumn::occupied, 1);
}
if($this->isAttacker()){
@@ -200,7 +202,7 @@ class WarUnitGeneral extends WarUnit
function addLose()
{
$general = $this->general;
$general->increaseRankVar('deathnum', 1);
$general->increaseRankVar(RankColumn::deathnum, 1);
$this->addStatExp(1);
}
@@ -340,14 +342,14 @@ class WarUnitGeneral extends WarUnit
$this->isFinished = true;
$general = $this->general;
$general->increaseRankVar('killcrew', $this->killed);
$general->increaseRankVar('deathcrew', $this->dead);
$general->increaseRankVar(RankColumn::killcrew, $this->killed);
$general->increaseRankVar(RankColumn::deathcrew, $this->dead);
if($this->killedPerson){
$general->increaseRankVar('killcrew_person', $this->killedPerson);
$general->increaseRankVar(RankColumn::killcrew_person, $this->killedPerson);
}
if($this->deadPerson){
$general->increaseRankVar('deathcrew_person', $this->deadPerson);
$general->increaseRankVar(RankColumn::deathcrew_person, $this->deadPerson);
}
$general->updateVar('rice', Util::round($general->getVar('rice')));