public static void OnResExchange(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if (msg.stPkgData.stWealExchangeRes.dwWealID != 0u)
            {
                ListView <CUseable> useableListFromItemList = CUseableManager.GetUseableListFromItemList(msg.stPkgData.stWealExchangeRes.stExchangeRes);
                if (useableListFromItemList.Count > 0)
                {
                    CUseableManager.ShowUseableItem(useableListFromItemList[0]);
                }
                if (msg.stPkgData.stWealExchangeRes.bWealType == 4)
                {
                    ExchangeActivity exchangeActivity = (ExchangeActivity)Singleton <ActivitySys> .GetInstance().GetActivity(COM_WEAL_TYPE.COM_WEAL_EXCHANGE, msg.stPkgData.stWealExchangeRes.dwWealID);

                    if (exchangeActivity != null)
                    {
                        exchangeActivity.IncreaseExchangeCount((int)msg.stPkgData.stWealExchangeRes.bWealIdx, msg.stPkgData.stWealExchangeRes.dwDrawCnt);
                        exchangeActivity.UpdateView();
                    }
                }
                else if (msg.stPkgData.stWealExchangeRes.bWealType == 5)
                {
                    PointsExchangeActivity pointsExchangeActivity = (PointsExchangeActivity)Singleton <ActivitySys> .GetInstance().GetActivity(COM_WEAL_TYPE.COM_WEAL_PTEXCHANGE, msg.stPkgData.stWealExchangeRes.dwWealID);

                    if (pointsExchangeActivity != null)
                    {
                        pointsExchangeActivity.IncreaseExchangeCount((int)msg.stPkgData.stWealExchangeRes.bWealIdx, msg.stPkgData.stWealExchangeRes.dwDrawCnt);
                        pointsExchangeActivity.UpdateView();
                    }
                }
                return;
            }
        }
        public static void OnResetAllExchangeCount()
        {
            ListView <Activity> activityList = Singleton <ActivitySys> .GetInstance().GetActivityList((Activity actv) => actv.Type == COM_WEAL_TYPE.COM_WEAL_EXCHANGE);

            for (int i = 0; i < activityList.Count; i++)
            {
                ExchangeActivity exchangeActivity = activityList[i] as ExchangeActivity;
                if (exchangeActivity != null)
                {
                    exchangeActivity.ResetExchangeCount();
                    exchangeActivity.UpdateView();
                }
            }
            ListView <Activity> activityList2 = Singleton <ActivitySys> .GetInstance().GetActivityList((Activity actv) => actv.Type == COM_WEAL_TYPE.COM_WEAL_PTEXCHANGE);

            for (int j = 0; j < activityList2.Count; j++)
            {
                PointsExchangeActivity pointsExchangeActivity = activityList2[j] as PointsExchangeActivity;
                if (pointsExchangeActivity != null)
                {
                    pointsExchangeActivity.ResetExchangeCount();
                    pointsExchangeActivity.UpdateView();
                }
            }
        }
Ejemplo n.º 3
0
        public static void OnResetAllExchangeCount()
        {
            ListView <Activity> activityList = Singleton <ActivitySys> .GetInstance().GetActivityList((Activity actv) => actv.Type == 4);

            for (int i = 0; i < activityList.get_Count(); i++)
            {
                ExchangeActivity exchangeActivity = activityList.get_Item(i) as ExchangeActivity;
                if (exchangeActivity != null)
                {
                    exchangeActivity.ResetExchangeCount();
                    exchangeActivity.UpdateView();
                }
            }
            ListView <Activity> activityList2 = Singleton <ActivitySys> .GetInstance().GetActivityList((Activity actv) => actv.Type == 5);

            for (int j = 0; j < activityList2.get_Count(); j++)
            {
                PointsExchangeActivity pointsExchangeActivity = activityList2.get_Item(j) as PointsExchangeActivity;
                if (pointsExchangeActivity != null)
                {
                    pointsExchangeActivity.ResetExchangeCount();
                    pointsExchangeActivity.UpdateView();
                }
            }
        }
Ejemplo n.º 4
0
        public static void OnResExchange(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if ((msg.stPkgData.stWealExchangeRes.dwWealID != 0) && (msg.stPkgData.stWealExchangeRes.bWealIdx != 0))
            {
                ListView <CUseable> useableListFromItemList = CUseableManager.GetUseableListFromItemList(msg.stPkgData.stWealExchangeRes.stExchangeRes);
                if (useableListFromItemList.Count > 0)
                {
                    CUseableManager.ShowUseableItem(useableListFromItemList[0]);
                }
                ExchangeActivity activity = (ExchangeActivity)Singleton <ActivitySys> .GetInstance().GetActivity(COM_WEAL_TYPE.COM_WEAL_EXCHANGE, msg.stPkgData.stWealExchangeRes.dwWealID);

                if (activity != null)
                {
                    activity.IncreaseExchangeCount(msg.stPkgData.stWealExchangeRes.bWealIdx);
                    activity.UpdateView();
                }
            }
        }