当前位置: 首页>>代码示例>>C#>>正文


C# PlayerStats.Add方法代码示例

本文整理汇总了C#中PlayerStats.Add方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerStats.Add方法的具体用法?C# PlayerStats.Add怎么用?C# PlayerStats.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerStats的用法示例。


在下文中一共展示了PlayerStats.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPlayerStats

        protected override PlayerStats GetPlayerStats(string playerName, IEnumerable<Game> games)
        {
            var statCollection = new PlayerStats(playerName);
            var playerGames = games.GetGamesForPlayer(playerName).ToList();
            if (true)//win % stat
            {
                var wp = playerGames.GetHandsWonPercentForPlayerGames(playerName);
                statCollection.Add(new Stat() { Name = "Win %", Value = Math.Round(wp, 2) });
            }
            if (true)//hands
                statCollection.Add(new Stat() { Name = "Hands", Value = playerGames.Count() });

            if (true)//VPIP
            {
                var vpip = playerGames.VPIP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "VPIP", Value = Math.Round(vpip, 2) });
            }
            if (true)//EP VPIP
            {
                var vpip = playerGames.VPIP_EP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "EP VPIP", Value = Math.Round(vpip, 2) });
            }
            if (true)//MP VPIP
            {
                var vpip = playerGames.VPIP_MP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "MP VPIP", Value = Math.Round(vpip, 2) });
            }
            if (true)//LP VPIP
            {
                var vpip = playerGames.VPIP_LP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "LP VPIP", Value = Math.Round(vpip, 2) });
            }
            if (true)//Profit
            {
                var profit = playerGames.CalculateTotalProfit(playerName);
                statCollection.Add(new Stat() { Name = "Profit", Value = Math.Round(profit, 2) });
            }
            if (true)//PFR
            {
                var prc = playerGames.PFR_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "PFR", Value = Math.Round(prc, 2) });
            }
            if (true)//EP PFR
            {
                var prc = playerGames.PFR_EP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "EP PFR", Value = Math.Round(prc, 2) });
            }
            if (true)//MP PFR
            {
                var prc = playerGames.PFR_MP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "MP PFR", Value = Math.Round(prc, 2) });
            }
            if (true)//LP PFR
            {
                var prc = playerGames.PFR_LP_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "LP PFR", Value = Math.Round(prc, 2) });
            }
            if (true)//ATS
            {
                var atsPercent = playerGames.ATS_PercentForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "ATS", Value = Math.Round(atsPercent, 2) });
            }
            if (true)//CO ATS
            {
                var atsPercent = playerGames.ATS_CO_PercentForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "CO ATS", Value = Math.Round(atsPercent, 2) });
            }
            if (true)//B ATS
            {
                var atsPercent = playerGames.ATS_B_PercentForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "B ATS", Value = Math.Round(atsPercent, 2) });
            }
            if (true)//SB ATS
            {
                var atsPercent = playerGames.ATS_SB_PercentForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "SB ATS", Value = Math.Round(atsPercent, 2) });
            }
            if (true)
                statCollection.Add(new Stat() { Name = "BB", Value = Math.Round(playerGames.Last().BB_ForPlayer(playerName)) });

            if (true) //AF
            {
                var afPercent = playerGames.AF_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "AF", Value = Math.Round(afPercent, 2) });
            }
            if (true) //AF Flop
            {
                var afPercent = playerGames.AF_Flop_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "AF Flop", Value = Math.Round(afPercent, 2) });
            }
            if (true) //AF Turn
            {
                var afPercent = playerGames.AF_Turn_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "AF Turn", Value = Math.Round(afPercent, 2) });
            }
            if (true) //AF River
            {
                var afPercent = playerGames.AF_River_ForPlayer(playerName);
                statCollection.Add(new Stat() { Name = "AF River", Value = Math.Round(afPercent, 2) });
            }
//.........这里部分代码省略.........
开发者ID:Dima-F,项目名称:MoneyMaker,代码行数:101,代码来源:BaseStatOperator.cs

示例2: GetPlayerStats

        protected override PlayerStats GetPlayerStats(string playerName, IEnumerable<Game> games)
        {
            var statCollection = new PlayerStats(playerName);
            var playerGames = games.GetGamesForPlayer(playerName).ToList();
            //counters...
            var pgCount = playerGames.Count;
            var winCount = 0;

            var vpipCount = 0;
            var vpipEpCount = 0;
            var vpipMpCount = 0;
            var vpipLpCount = 0;

            var pfrCount = 0;
            var pfrEpCount = 0;
            var pfrMpCount = 0;
            var pfrLpCount = 0;

            var totalProfit = 0.0d;
            var sawFlopCount = 0;
            var winWherSawFlop = 0;
            var showdownCount = 0;

            var afArray = new List<Af>()
            {
                new Af(),//general 0
                new Af(),//flop 1
                new Af(),//turn 2
                new Af()//river 3
            };

            var threeBetCount = 0;

            foreach (var g in playerGames)
            {
                var plH = g.PlayerHistories.First(ph => ph.PlayerName == playerName);
                winCount += plH.WinForPlayer();

                vpipCount += plH.Vpip();
                vpipEpCount += plH.VpipEp();
                vpipMpCount += plH.VpipMp();
                vpipLpCount += plH.VpipLp();

                pfrCount += plH.Pfr();
                pfrEpCount += plH.PfrEp();
                pfrMpCount += plH.PfrMp();
                pfrLpCount += plH.PfrLp();

                plH.AF_(afArray[0]);
                plH.AF_Flop(afArray[1]);
                plH.AF_Turn(afArray[2]);
                plH.AF_River(afArray[3]);

                threeBetCount += plH.ThreeBet(g);
                totalProfit += plH.HandProfit();

                if (g.SawFlopForPlayer(playerName))
                {
                    sawFlopCount++;
                    if (g.IsWinGameForPlayer(playerName))
                        winWherSawFlop++;
                }

                showdownCount += plH.ReachShowdown();

            }
            if (true)//win % stat ++
            {
                statCollection.Add(new Stat() { Name = "Win %", Value = Math.Round((double)winCount/pgCount * 100, 2) });
            }
            if (true)//hands ++
                statCollection.Add(new Stat() { Name = "Hands", Value = playerGames.Count });

            if (true)//VPIP ++
            {
                statCollection.Add(new Stat() { Name = "VPIP", Value = Math.Round((double)vpipCount/playerGames.Count * 100, 2) });
            }
            if (true)//EP VPIP ++
            {
                statCollection.Add(new Stat() { Name = "EP VPIP", Value = Math.Round((double)vpipEpCount / playerGames.Count * 100, 2) });
            }
            if (true)//MP VPIP ++
            {
                statCollection.Add(new Stat() { Name = "MP VPIP", Value = Math.Round((double)vpipMpCount / playerGames.Count * 100, 2) });
            }
            if (true)//LP VPIP ++
            {
                statCollection.Add(new Stat() { Name = "LP VPIP", Value = Math.Round((double)vpipLpCount / playerGames.Count * 100, 2) });
            }
            if (true)//Profit ++
            {
                statCollection.Add(new Stat() { Name = "Profit", Value = Math.Round(totalProfit, 2) });
            }
            if (true)//PFR ++
            {
                statCollection.Add(new Stat() { Name = "PFR", Value = Math.Round((double)pfrCount / playerGames.Count * 100, 2) });
            }
            if (true)//EP PFR ++
            {
                statCollection.Add(new Stat() { Name = "EP PFR", Value = Math.Round((double)pfrEpCount / playerGames.Count * 100, 2) });
//.........这里部分代码省略.........
开发者ID:Dima-F,项目名称:MoneyMaker,代码行数:101,代码来源:FastStatOperator.cs


注:本文中的PlayerStats.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。