1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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 $gemStore;
-
- /**
- * 装备界面默认页
- * @var type
- */
- public $equipPag =1;
- /**
- * 装备
- * @var type
- */
- public $equip;
-
- /**
- * 宝石装备的信息
- * @var type
- */
- public $gemEquip;
- /**
- * 装备信息 装备不跟hero走--废弃
- * @var type
- */
- public $equipPosition = null;
-
-
-
- public function initialize() {
- $this->items = new \stdClass();
- $this->gemStore = new \stdClass();
- $this->equip = new \stdClass();
- $this->gemEquip = new \stdClass();
- }
- public function __construct($arg = null) {
- if ($arg == null) {
- $this->items = new \stdClass();
- $this->gemStore = new \stdClass();
- $this->equip = new \stdClass();
- for ($i = 1; $i <=6; $i++) {
- $this->equip->$i = new Ins_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);
- }
- }
- }
- }
|