Ejemplo n.º 1
0
    public override void read(ErlKVMessage message)
    {
        ErlArray array = message.getValue("msg") as ErlArray;

        if (array != null)
        {
            //通信成功之后清楚老数据
            FestivalWishManagerment.Instance.festivalWishs.Clear();
            for (int i = 0; i < array.Value.Length; i++)
            {
                ErlArray _array = array.Value[i] as ErlArray;
                if (_array != null)
                {
                    int          poss = 0;
                    FestivalWish wish = new FestivalWish();
                    wish.sid            = StringKit.toInt(_array.Value [poss++].getValueString());
                    wish.currentWishNum = StringKit.toInt(_array.Value [poss++].getValueString());
                    wish.state          = StringKit.toInt(_array.Value [poss++].getValueString());
                    wish.endTime        = StringKit.toInt(_array.Value [poss++].getValueString());
                    wish.sample         = FestivalWishSampleManager.Instance.getFestivalWishSampleBySid(wish.sid);
                    if (wish.endTime != -1 && wish.endTime != 0)
                    {
                        FestivalWishManagerment.Instance.festivalWishs.Add(wish);
                    }
                }
            }
        }

        if (callback != null)
        {
            callback();
            callback = null;
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 初始化UI
 /// </summary>
 public void initItemUI(FestivalWish wish, WindowBase fatherwindow)
 {
     this.festivalwish = wish;
     this.win          = fatherwindow;
     this.goodsView.init(wish.sample.prizes);
     this.goodsView.fatherWindow = fatherwindow;
     this.currentPersonNum.text  = LanguageConfigManager.Instance.getLanguage("noticeActivityFW_07", wish.currentWishNum.ToString(), wish.sample.maxWishsNum.ToString());
     wishProgress.updateValue(wish.currentWishNum, wish.sample.maxWishsNum);
     this.oldCostLabel.text  = wish.sample.oldCost.ToString();
     this.wishCostLabel.text = wish.sample.wishCost.ToString();
     initButton();
     startTimer();
     updateTime();
 }