123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- namespace loyalsoft;
- /**
- * Description of Info_Store
- *
- * @author c'y'zhao
- */
- class Info_Store extends Object_ext {
- /**
- * 道具
- * @var type
- */
- public $items;
- /**
- * 装备
- * @var type
- */
- public $equip;
- /**
- * 装备信息 装备不跟hero走
- * @var type
- */
- public $equipPosition = null;
-
- public function initialize() {
- $this->items = new \stdClass();
- $this->equip = new \stdClass();
- $this->equipPosition = new \stdClass();
- }
- public function __construct($arg = null) {
- if ($arg == null) {
- $this->items = new \stdClass();
- $this->equip = new \stdClass();
- $this->equipPosition = new \stdClass();
- } else {
- parent::__construct($arg);
- }
- }
- public function removeItem($itemId, $num) {
- if (StlUtil::dictHasProperty($this->items, $itemId)) {
- $this->items->$itemId -= $num;
- if ($this->items->$itemId <= 0) {
- unset($this->items->$itemId);
- }
- }
- }
- }
|