123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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 \stdClass()
- */
- public $items;
-
- /**
- * 宝石在背包库的唯一id
- * @var type
- */
- public $gemLength = 0;
- /**
- * 宝石背包
- * \stdClass()
- */
- public $gemStore;
-
- /**
- * 装备界面默认页
- * @var int
- */
- public $equipPag =1;
- /**
- * 装备背包数据
- * @var \stdClass()
- */
- public $equip;
-
- /**
- * 装备部位--废弃
- * @var \stdClass()
- */
- public $equipPosition;
-
- /**
- * 6个装备部位
- * @var type
- */
- public $equipLocation;
-
- /**
- * 宝石装备的信息
- * @var \stdClass()
- */
- public $gemEquip;
- /**
- * 装备信息 装备不跟hero走--废弃
- * @var type
- */
- //public $equipPosition = null;
-
- public $gemComposeNum = 0;
-
- public function initialize() {
-
- }
- public function __construct($arg = null) {
- if ($arg == null) {
- $this->items = new \stdClass();
- $this->gemStore = new \stdClass();
- $this->equip = new \stdClass();
- $this->equipLocation = new \stdClass();
-
- $this->equipPosition = new \stdClass();
- for ($i = 1; $i <=6; $i++) {
- $equip = new Ins_EquipPosition();
- $equip->typeId = $i;
- $this->equipPosition->$i = $equip;
- }
-
- $this->gemEquip = new \stdClass();
- for ($k = 1; $k <=3; $k++) {
- $item = new \stdClass();
- for ($j = 1; $j <= 6; $j++) {
- $item->$j = new \stdClass();
- }
- $this->gemEquip->$k =$item;
- }
-
-
- } 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);
- }
- }
- }
- }
|