Esempio n. 1
0
    public override void parseConfig(string str)
    {
        LotteryBuyCountSample sample = new LotteryBuyCountSample(str);

        if (countSample == null)
        {
            countSample = new List <LotteryBuyCountSample> ();
        }
        countSample.Add(sample);
    }
Esempio n. 2
0
    // 是否有足够的金币钻币购买彩票//
    public bool enoughToBuy(int vipLv)
    {
        int costGoldCount;
        int costRmbCount;
        int hasBuyCount;        // 购买次数//
        LotteryBuyCountSample sample = LotteryBuyCountConfigManager.Instance.getCountSample(vipLv);

        if (sample != null)
        {
            costGoldCount = sample.goldCount;
            costRmbCount  = sample.rmbCount;
            hasBuyCount   = LotteryManagement.instance.currentDayBuyCount;
            if (hasBuyCount < costGoldCount)
            {
                // 金币不足//
                if (UserManager.Instance.self.getMoney() < CommandConfigManager.Instance.getLotteryData().costGold)
                {
                    UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                        win.Initialize(LanguageConfigManager.Instance.getLanguage("Lottery_goldNotEough"));
                    });
                    return(false);
                }
            }
            else
            {
                // 钻币不足//
                if (UserManager.Instance.self.getRMB() < CommandConfigManager.Instance.getLotteryData().costRmb)
                {
                    UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                        win.Initialize(LanguageConfigManager.Instance.getLanguage("Lottery_rmbNotEough"));
                    });
                    return(false);
                }
            }
            return(true);
        }
        return(false);
    }