|
@@ -19,6 +19,18 @@ class Data_UserGame extends HashSaver {
|
|
|
* @var Info_Store
|
|
|
*/
|
|
|
public $store;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关卡
|
|
|
+ * @var Info_Gates
|
|
|
+ */
|
|
|
+ public $gates;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关卡
|
|
|
+ * @var type
|
|
|
+ */
|
|
|
+ public $heros;
|
|
|
|
|
|
/**
|
|
|
* @var string token
|
|
@@ -41,6 +53,8 @@ class Data_UserGame extends HashSaver {
|
|
|
//$this->baseInfo = new Info_UserBase();
|
|
|
$this->baseInfo->initialize();
|
|
|
$this->store->initialize();
|
|
|
+ $this->gates->initialize();
|
|
|
+ $this->heros->initialize();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -51,6 +65,8 @@ class Data_UserGame extends HashSaver {
|
|
|
if (null === $arg) { # 未传参数的情况下
|
|
|
$this->baseInfo = new Info_UserBase();
|
|
|
$this->store = new Info_Store();
|
|
|
+ $this->gates = new Info_Gates();
|
|
|
+ $this->heros = new Info_Heros();
|
|
|
} else { # 实参
|
|
|
parent::__construct($arg); # 调用Object的构造函数
|
|
|
|
|
@@ -60,6 +76,19 @@ class Data_UserGame extends HashSaver {
|
|
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="实例方法">
|
|
|
|
|
|
+ /**
|
|
|
+ * 关卡数据
|
|
|
+ * @param bool $save 是否需要回存
|
|
|
+ * @return Info_UserGateDifficulty
|
|
|
+ */
|
|
|
+ public function gates($save = true) {
|
|
|
+ $this->gates = new Info_Gates($this->gates);
|
|
|
+ if ($save) {
|
|
|
+ self::save_tag("gates");
|
|
|
+ }
|
|
|
+ return $this->gates;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 基础信息
|
|
|
* @param bool $save 是否需要回存
|
|
@@ -118,7 +147,7 @@ class Data_UserGame extends HashSaver {
|
|
|
* @return Info_UserGameHero
|
|
|
*/
|
|
|
public function heros($save = true) {
|
|
|
- $this->heros = new Info_UserGameHero($this->heros);
|
|
|
+ $this->heros = new Info_Heros($this->heros);
|
|
|
if ($save) {
|
|
|
self::save_tag("heros");
|
|
|
}
|
|
@@ -138,19 +167,6 @@ class Data_UserGame extends HashSaver {
|
|
|
return $this->privateState;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 关卡数据
|
|
|
- * @param bool $save 是否需要回存
|
|
|
- * @return Info_UserGateDifficulty
|
|
|
- */
|
|
|
- public function gates($save = true) {
|
|
|
- $this->gates = new Info_UserGateDifficulty($this->gates);
|
|
|
- if ($save) {
|
|
|
- self::save_tag("gates");
|
|
|
- }
|
|
|
- return $this->gates;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 新地图数据
|
|
|
* @param bool $save 是否需要回存
|