|
@@ -27,16 +27,35 @@ class Info_Heros extends Object_ext {
|
|
public $Dic = null;
|
|
public $Dic = null;
|
|
|
|
|
|
public function initialize() {
|
|
public function initialize() {
|
|
- $curHeroId = 1; //临时
|
|
|
|
- $this->CurrentHeroId = $curHeroId;
|
|
|
|
- $this->Dic = new \stdClass();
|
|
|
|
- $insHero = new Ins_Hero();
|
|
|
|
- $insHero->Id = $curHeroId;
|
|
|
|
- $this->Dic->$curHeroId = $insHero;
|
|
|
|
- $id2 = 2;
|
|
|
|
- $ins2 = new Ins_Hero();
|
|
|
|
- $ins2->Id = 2;
|
|
|
|
- $this->Dic->$id2 = $ins2;
|
|
|
|
|
|
+ $heroConf = GameConfig::hero();
|
|
|
|
+
|
|
|
|
+ foreach ($heroConf as $heroId => $mo) {
|
|
|
|
+ if(!StlUtil::dictHasProperty($this->Dic, $heroId) ){
|
|
|
|
+ $insHero = new Ins_Hero();
|
|
|
|
+ $insHero->Id = $heroId;
|
|
|
|
+ $insHero->isUnlock = 0;
|
|
|
|
+ if($heroId == 1 && $heroId == 2){
|
|
|
|
+ $insHero->isUnlock = 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->Dic->$heroId = $insHero;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($this->CurrentHeroId == 0){
|
|
|
|
+ $this->CurrentHeroId = 1;
|
|
|
|
+ }
|
|
|
|
+// $curHeroId = 1; //临时
|
|
|
|
+// $this->CurrentHeroId = $curHeroId;
|
|
|
|
+// $this->Dic = new \stdClass();
|
|
|
|
+// $insHero = new Ins_Hero();
|
|
|
|
+// $insHero->Id = $curHeroId;
|
|
|
|
+// $this->Dic->$curHeroId = $insHero;
|
|
|
|
+// $id2 = 2;
|
|
|
|
+// $ins2 = new Ins_Hero();
|
|
|
|
+// $ins2->Id = 2;
|
|
|
|
+// $this->Dic->$id2 = $ins2;
|
|
}
|
|
}
|
|
|
|
|
|
public function __construct($arg = null) {
|
|
public function __construct($arg = null) {
|