Example #1
0
 private ActionResult BuildActionResult(SportType sportType, Dictionary<DateTime, List<Dictionary<BetOddType, BetItemTransport>>> data)
 {
     return new ActionResultCached(data != null,
         () => data.MaxOrDefault(d => d.Key, DateTime.MinValue),
         () => {
             var res = new List<Dictionary<string, double>>();
             var addDraw = BetHelper.SportTypeWithOdds[sportType].Contains(BetOddType.Draw);
             data
                 .OrderBy(d => d.Key)
                 .Each(betItems => {
                     var list = betItems.Value;
                     var dict = new Dictionary<string, double> {
                         {"d", (betItems.Key - ProjectBConsts.DefaultLinuxUtc).TotalMilliseconds},
                         {"w1", BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.Win1, list, Enumerable.Max)},
                         {"w2", BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.Win2, list, Enumerable.Max)},
                         {"r1x2", BetOddInterfaceHelper.GetBetOddRoi(RoiType.Roi1X2, sportType, list)},
                         {"h1", BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.Handicap1, list, Enumerable.Max)},
                         {"h2", BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.Handicap2, list, Enumerable.Max)},
                         {"rh", BetOddInterfaceHelper.GetBetOddRoi(RoiType.RoiHandicap, sportType, list)},
                         {"tu", BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.TotalUnder, list, Enumerable.Max)},
                         {"to", BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.TotalOver, list, Enumerable.Max)},
                         {"rt", BetOddInterfaceHelper.GetBetOddRoi(RoiType.RoiTotal, sportType, list)},
                     };
                     if (addDraw) {
                         dict["x"] = BetOddInterfaceHelper.GetOddValue(sportType, BetOddType.Draw, list, Enumerable.Max);
                     }
                     res.Add(dict);
                 });
             return new JsonResult {
                 Data = res
             };
         });
 }
Example #2
0
        static void LaneClear()
        {
            var useQ = Menu.SubMenu("LaneClear").Item("UseQLC").GetValue<bool>();
            var useW = Menu.SubMenu("LaneClear").Item("UseWLC").GetValue<bool>();

            var minions = MinionManager.GetMinions(Q.Range);
            if(minions.Count == 0)
            {
                minions = MinionManager.GetMinions(Q.Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth);
            }

            if (minions.Count > 0)
            {
                if (useW && W.Instance.Ammo > 0 && (minions.Count > 2 || minions[0].Team == GameObjectTeam.Neutral))
                {
                    var p = Player.Position.To2D().Extend(minions[0].Position.To2D(), W.Range);
                    W.Cast(p);
                    return;
                }

                if (useQ && Qline.IsReady() && (minions.Count >= 2 || minions[0].Team == GameObjectTeam.Neutral))
                {
                    var positions = new Dictionary<Vector3, int>();

                    foreach (var soldier in SoldiersManager.AllSoldiers)
                    {
                        Qline.UpdateSourcePosition(soldier.ServerPosition, ObjectManager.Player.ServerPosition);
                        foreach (var minion in minions)
                        {
                            var hits = Qline.CountHits(minions.Select(m => m.ServerPosition).ToList(), minion.ServerPosition);
                            if (hits >= 2 || minions[0].Team == GameObjectTeam.Neutral)
                            {
                                if(!positions.ContainsKey(minion.ServerPosition))
                                {
                                    positions.Add(minion.ServerPosition, hits);
                                }
                            }
                        }
                    }

                    if(positions.Count > 0)
                    {
                        Qline.Cast(positions.MaxOrDefault(k => k.Value).Key);
                    }
                }
                return;
            }
        }