123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?php
- namespace loyalsoft;
- /**
- * 抽奖卡槽
- */
- class LotterySlotModel extends Object_ext
- {
- /*
- * 有4个卡槽, 按照等级解锁, 可花钻石提前解锁,
- * 每个卡槽上可以托管一张抽奖后获得的英雄. 并开始冷却计时
- * 冷却计时完成后, 可以收取对应的卡牌
- * 涉及到的数据结构:
- * 卡槽id,
- * 解锁状态,
- * 英雄modle_id,
- * 英雄星级,
- * 冷却时间,
- */
- /**
- * @var int 卡槽id
- */
- public $id;
- /**
- * @var bool 解锁状态
- */
- public $locked = true;
- /**
- * @var int 英雄(原型)编号
- */
- public $herotype = 0;
- /**
- * @var int 英雄(实例)星级
- */
- public $herostar = 0;
- /**
- * @var ts 开放时间戳
- */
- public $opents = 0;
- public function Clear()
- {
- $this->herostar = 0;
- $this->herotype = 0;
- $this->opents = 0;
- }
- }
- /**
- * 设计一些卡槽
- * @version
- * 1.0.0 Created at 2017-7-20. by --gwang
- * @author gwang (mail@wanggangzero.cn)
- * @copyright ? 2017-7-20, SJZ LoyalSoft Corporation & gwang. All rights reserved.
- */
- class UserLotteryModel extends Object_ext
- {
- /**
- * @var {} 当天抽奖记录(类型=>次数)
- */
- public $todayLotterys;
- /**
- * @var {} 总的抽奖记录(类型=>次数)
- */
- public $totalLotterys;
- /**
- * @var {} 保底奖励计数器(类型=>次数)
- */
- public $baodiLotterys;
- /**
- * @var {} 保底奖励领取记录(类型=>次数)
- */
- public $baodiDrawed;
- public function __construct($arg = null)
- {
- if (func_num_args() == 1 && !is_null($arg)) {
- parent::__construct($arg);
- }
- if (!isset($this->slot0)) {
- $this->slot0 = new LotterySlotModel(array('id' => 0, 'locked' => false));
- }
- if (!isset($this->slot1)) {
- $this->slot1 = new LotterySlotModel(array('id' => 1));
- }
- if (!isset($this->slot2)) {
- $this->slot2 = new LotterySlotModel(array('id' => 2));
- }
- if (!isset($this->slot3)) {
- $this->slot3 = new LotterySlotModel(array('id' => 3));
- }
- if (!isset($this->todayLotterys)) {
- $this->todayLotterys = ObjectInit();
- }
- if (!isset($this->totalLotterys)) {
- $this->totalLotterys = ObjectInit();
- }
- if (!isset($this->baodiLotterys)) {
- $this->baodiLotterys = ObjectInit();
- }
- if (!isset($this->baodiDrawed)) {
- $this->baodiDrawed = ObjectInit();
- }
- }
- }
|