refac: General create 함수명 변경

This commit is contained in:
2023-08-01 16:28:29 +00:00
parent 29273d7a8b
commit 55fca2337d
68 changed files with 87 additions and 89 deletions
+1 -5
View File
@@ -7,11 +7,7 @@ use \sammo\{
Util,
JosaUtil,
General,
DummyGeneral,
ActionLogger,
GameConst,
LastTurn,
GameUnitConst,
Command,
ScoutMessage
};
@@ -77,7 +73,7 @@ class che_등용 extends Command\GeneralCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation', 'experience', 'dedication'], GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID']);
$this->setDestGeneral($destGeneral);
[$reqGold, $reqRice] = $this->getCost();
@@ -68,7 +68,7 @@ class che_등용수락 extends Command\GeneralCommand{
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null);
$this->setDestGeneral($destGeneral);
$this->setDestNation($this->arg['destNationID'], ['gennum', 'scout']);
@@ -67,7 +67,7 @@ class che_모반시도 extends Command\GeneralCommand{
$lordID = $db->queryFirstField('SELECT no FROM general WHERE nation = %i AND officer_level = 12', $nationID);
$lordGeneral = General::createGeneralObjFromDB($lordID);
$lordGeneral = General::createObjFromDB($lordID);
$generalName = $general->getName();
$lordName = $lordGeneral->getName();
+1 -1
View File
@@ -66,7 +66,7 @@ class che_선양 extends Command\GeneralCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$this->fullConditionConstraints = [
@@ -84,7 +84,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
protected function initWithArg()
{
$destGeneralID = $this->arg['destGeneralID'];
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['nation'], GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['nation'], GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$this->setDestNation($this->destGeneralObj->getVar('nation'), ['gennum', 'scout']);
+1 -1
View File
@@ -87,7 +87,7 @@ class che_증여 extends Command\GeneralCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$this->fullConditionConstraints = [
+1 -1
View File
@@ -269,7 +269,7 @@ class che_화계 extends Command\GeneralCommand
$destCityGeneralList = [];
$cityGeneralID = $db->queryFirstColumn('SELECT no FROM general WHERE city = %i AND nation = %i', $destCityID, $destNationID);
$destCityGeneralList = General::createGeneralObjListFromDB($cityGeneralID, ['name', 'city', 'nation', 'officer_level', 'leadership', 'horse', 'strength', 'weapon', 'intel', 'book', 'item', 'last_turn', 'injury', 'special', 'special2', 'injury', 'crewtype', 'crew', 'atmos', 'train']);
$destCityGeneralList = General::createObjListFromDB($cityGeneralID, ['name', 'city', 'nation', 'officer_level', 'leadership', 'horse', 'strength', 'weapon', 'intel', 'book', 'item', 'last_turn', 'injury', 'special', 'special2', 'injury', 'crewtype', 'crew', 'atmos', 'train']);
foreach ($destCityGeneralList as &$destCityGeneral) {
$destCityGeneral->setRawCity($this->destCity);
unset($destCityGeneral);
+1 -1
View File
@@ -92,7 +92,7 @@ class che_몰수 extends Command\NationCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'npc', 'nation', 'imgsvr', 'picture'], GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'npc', 'nation', 'imgsvr', 'picture'], GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$env = $this->env;
+1 -1
View File
@@ -72,7 +72,7 @@ class che_발령 extends Command\NationCommand
{
$this->setDestCity($this->arg['destCityID']);
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
if ($this->arg['destGeneralID'] == $this->getGeneral()->getID()) {
@@ -104,7 +104,7 @@ class che_불가침수락 extends Command\NationCommand
$env = $this->env;
$relYear = $env['year'] - $env['startyear'];
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$this->setDestNation($this->arg['destNationID']);
@@ -78,7 +78,7 @@ class che_불가침파기수락 extends Command\NationCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$this->setDestNation($this->arg['destNationID']);
@@ -87,7 +87,7 @@ class che_종전수락 extends Command\NationCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], null, GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
$this->setDestNation($this->arg['destNationID']);
+1 -1
View File
@@ -82,7 +82,7 @@ class che_포상 extends Command\NationCommand
protected function initWithArg()
{
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], GeneralQueryMode::Lite);
$destGeneral = General::createObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], GeneralQueryMode::Lite);
$this->setDestGeneral($destGeneral);
if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){
@@ -95,7 +95,7 @@ class che_필사즉생 extends Command\NationCommand{
$broadcastMessage = "<Y>{$generalName}</>{$josaYi} <M>필사즉생</>을 발동하였습니다.";
$targetGeneralList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND no != %i', $nationID, $generalID);
foreach(General::createGeneralObjListFromDB($targetGeneralList, ['train', 'atmos'], GeneralQueryMode::Lite) as $targetGeneral){
foreach(General::createObjListFromDB($targetGeneralList, ['train', 'atmos'], GeneralQueryMode::Lite) as $targetGeneral){
$targetGeneral->getLogger()->pushGeneralActionLog($broadcastMessage, ActionLogger::PLAIN);
if($targetGeneral->getVar('train') < 100){
$targetGeneral->setVar('train', 100);
+1 -1
View File
@@ -163,7 +163,7 @@ class che_허보 extends Command\NationCommand
$destNationCityList = $db->queryFirstColumn('SELECT city FROM city WHERE nation = %i AND supply = 1', $destNationID);
$targetGeneralList = $db->queryFirstColumn('SELECT no FROM general WHERE nation=%i AND city=%i', $destNationID, $destCityID);
foreach (General::createGeneralObjListFromDB($targetGeneralList) as $targetGeneralID => $targetGeneral) {
foreach (General::createObjListFromDB($targetGeneralList) as $targetGeneralID => $targetGeneral) {
$targetLogger = $targetGeneral->getLogger();
$targetLogger->pushGeneralActionLog($destBroadcastMessage, ActionLogger::PLAIN);