game2006api/webapp/services/ServerSwitch.php
hujiabin e4538c7ef6 1
2024-07-09 15:12:36 +08:00

50 lines
1.1 KiB
PHP

<?php
class ServerSwitch {
public function getConfig(){
if (!$this->switchConfig){
$this->initConfig();
}
return $this->switchConfig;
}
public function heroChainIsOpen(){
if ($this->getConfig()['heroChain'] > 0){
return true;
}
return false;
}
public function heroUpIsOpen(){
if ($this->getConfig()['heroUp'] > 0){
return true;
}
return false;
}
public function goldSynIsOpen(){
if ($this->getConfig()['goldSyn'] > 0){
return true;
}
return false;
}
public function heroPieceSynIsOpen(){
if ($this->getConfig()['heroPieceSyn'] > 0){
return true;
}
return false;
}
public function chipPieceSynIsOpen(){
if ($this->getConfig()['chipPieceSyn'] > 0){
return true;
}
return false;
}
private $switchConfig = null;
private function initConfig(){
$this->switchConfig = getServerSwitchConfig();
}
}