Exemple #1
0
        //public static int GetGamblerRPByUserID(int userID, Guid? leagueGuid = null)
        //{
        //    if (leagueGuid.HasValue)
        //        return DataAccess.Gambler.GetGamblerRPByUserID(userID, leagueGuid.Value);
        //    return DataAccess.Gambler.GetGamblerRPByUserID(userID);
        //}

        //public static void GamblerStatistics()
        //{
        //    var listGambler = GetGamblers();
        //    var listCasinoGambler = CasinoGambler.GetCasinoGamblers();

        //    var listCasinoCamblerContest = CasinoGambler.GetCasinoGamblers(ConfigGlobal.DefaultLeagueID);

        //    if (listCasinoCamblerContest != null && listCasinoCamblerContest.Count > 0)
        //    {
        //        listCasinoCamblerContest = CasinoGambler.SortCasinoGambler(listCasinoCamblerContest);
        //    }

        //    if (listGambler != null && listGambler.Count > 0 && listCasinoGambler != null && listCasinoGambler.Count > 0)
        //    {
        //        foreach (var g in listGambler)
        //        {
        //            var cg = listCasinoGambler.Find(
        //                delegate (CasinoGambler casinoGambler) { return casinoGambler.UserID.Equals(g.UserID); });

        //            if (cg != null)
        //                g.InitGambler(cg);

        //            var cgc = listCasinoCamblerContest.Find(
        //                delegate (CasinoGambler casinoGambler) { return casinoGambler.UserID.Equals(g.UserID); });

        //            if (cgc != null)
        //                g.ContestRank = cgc.Rank;
        //            else
        //                g.ContestRank = null;

        //            g.Update();
        //        }
        //    }
        //}

        public static void GamblerStatistics(int id)
        {
            var g  = new Gambler(id);
            var cg = CasinoGambler.GetCasinoGamblers().Find(x => x.UserID.Equals(id));

            CasinoGambler cgc = null;

            var listCasinoCamblerContest = CasinoGambler.GetCasinoGamblers(ConfigGlobal.DefaultLeagueID);

            if (listCasinoCamblerContest != null && listCasinoCamblerContest.Count > 0 &&
                listCasinoCamblerContest.Exists(x => x.UserID.Equals(id)))
            {
                listCasinoCamblerContest = CasinoGambler.SortCasinoGambler(listCasinoCamblerContest);

                cgc = listCasinoCamblerContest.Find(x => x.UserID.Equals(id));
            }

            if (cg != null)
            {
                g.InitGambler(cg);

                if (cgc != null)
                {
                    g.ContestRank = cgc.Rank;
                }
                else
                {
                    g.ContestRank = null;
                }
            }

            g.Update();
        }
Exemple #2
0
        private void InitGambler(CasinoGambler cg)
        {
            if (cg != null)
            {
                TotalBet  = cg.TotalBet;
                Win       = cg.Win;
                Lose      = cg.Lose;
                RPBonus   = cg.RPBonus;
                TotalRank = cg.Rank;

                // TODO: Add Gambler become Banker
                Banker = null;
            }
        }
Exemple #3
0
        private void InitGambler(CasinoGambler cg)
        {
            if (cg != null)
            {
                TotalBet = cg.TotalBet;
                Win = cg.Win;
                Lose = cg.Lose;
                RPBonus = cg.RPBonus;
                TotalRank = cg.Rank;

                // TODO: Add Gambler become Banker
                Banker = null;
            }
        }