|
@@ -14,41 +14,39 @@ namespace loyalsoft;
|
|
* @author c'y'zhao
|
|
* @author c'y'zhao
|
|
*/
|
|
*/
|
|
class Info_Store extends Object_ext {
|
|
class Info_Store extends Object_ext {
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 道具
|
|
* 道具
|
|
* @var type
|
|
* @var type
|
|
*/
|
|
*/
|
|
public $items;
|
|
public $items;
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 装备
|
|
* 装备
|
|
* @var type
|
|
* @var type
|
|
*/
|
|
*/
|
|
public $equip;
|
|
public $equip;
|
|
-
|
|
|
|
|
|
+
|
|
public function initialize() {
|
|
public function initialize() {
|
|
$this->items = new \stdClass();
|
|
$this->items = new \stdClass();
|
|
$this->equip = new \stdClass();
|
|
$this->equip = new \stdClass();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public function __construct($arg = null) {
|
|
public function __construct($arg = null) {
|
|
- if($tag == null){
|
|
|
|
|
|
+ if ($arg == null) {
|
|
$this->items = new \stdClass();
|
|
$this->items = new \stdClass();
|
|
- $this->equip = new \stdClass();
|
|
|
|
- }else{
|
|
|
|
|
|
+ $this->equip = new \stdClass();
|
|
|
|
+ } else {
|
|
parent::__construct($arg);
|
|
parent::__construct($arg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- public function removeItem($itemId,$num) {
|
|
|
|
- if(StlUtil::dictHasProperty($this->items, $itemId)){
|
|
|
|
|
|
+
|
|
|
|
+ public function removeItem($itemId, $num) {
|
|
|
|
+ if (StlUtil::dictHasProperty($this->items, $itemId)) {
|
|
$this->items->$itemId -= $num;
|
|
$this->items->$itemId -= $num;
|
|
- if($this->items->$itemId <= 0){
|
|
|
|
|
|
+ if ($this->items->$itemId <= 0) {
|
|
unset($this->items->$itemId);
|
|
unset($this->items->$itemId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|