public async static Task <GetStats> GetStats(GetID idroot, int platformindex) { try { using (HttpClient client = new HttpClient()) { var urlstats = Data.GenerateURLStats(idroot.uid, idroot.platforms[platformindex]); var responsenew = await client.GetAsync(urlstats); var jsonstats = await responsenew.Content.ReadAsStringAsync(); var statsroot = new GetStats(); statsroot = JsonConvert.DeserializeObject <GetStats>(jsonstats); return(statsroot); } } catch (Exception e) { GetStats error = new GetStats(); error.uid = "errornointernet"; return(error); } //we manually transfer the seasons and platforms because we cannot return two objects. //BUUUUT IT IS CRASHING SO WE WILL REVIEW IT AGAIN LATER... //statsroot.platforms = idroot.platforms; //statsroot.GetID.seasons = idroot.seasons; }
public List <GetStats> Chart() { List <GetStats> al = new List <GetStats>(); var GrpData = from data in _employeeRepository.GetAllSold() group data by data.Category.CategoryName into eGroup orderby eGroup.Key select new { Category = eGroup.Key, subData = eGroup.OrderBy(x => x.Price) }; foreach (var grp in GrpData) { GetStats gt = new GetStats(); gt.CategoryName = grp.Category; foreach (var p in grp.subData) { gt.TotalPrice = gt.TotalPrice + Convert.ToInt32(p.Price * p.Quantity); } al.Add(gt); } Console.WriteLine(al); return(al); }
private void Awake() { allSkills = FindObjectOfType <AllSkills>(); turnSystem = FindObjectOfType <TurnSystem>(); gridGenerator = FindObjectOfType <EditedGridGenerator>(); getStats = GetComponent <GetStats>(); }
// GET api/values/5 public List <Hotspot> Get(string id) { List <Hotspot> hs = new List <Hotspot>(); hs = GetStats.getStatForProvince(id); return(hs); }
// GET api/values public List <Hotspot> Get() { List <Hotspot> hs = new List <Hotspot>(); hs = GetStats.getAllStats(); return(hs); }
public object Get(GetStats request) { return(new GetStatsResponse { QuestionsCount = Db.Count <Question>(), AnswersCount = Db.Count <Answer>(), TagCounts = Db.Dictionary <string, long>("SELECT Tag, COUNT(*) FROM QuestionTag GROUP BY Tag HAVING COUNT(*) > 2 ORDER BY COUNT(*) DESC"), TopQuestionScore = Db.Scalar <Question, long>(x => Sql.Max(x.Score)), TopQuestionViews = Db.Scalar <Question, long>(x => Sql.Max(x.ViewCount)), TopAnswerScore = Db.Scalar <Answer, long>(x => Sql.Max(x.Score)), }); }
public HttpResponseMessage Get() { List <Hotspot> hs = new List <Hotspot>(); hs = GetStats.getAllStats(); if (hs == null) { var message = string.Format("Data Could Not Be Retrieved Please Try Again Later"); HttpError err = new HttpError(message); return(Request.CreateResponse(HttpStatusCode.NotFound, err)); } else { return(Request.CreateResponse(HttpStatusCode.OK, hs)); } }
public HttpResponseMessage Get(string id) { List <Hotspot> hs = new List <Hotspot>(); hs = GetStats.getStatForProvince(id); if (hs == null) { var message = string.Format("Hotspot with id = {0} not found", id); HttpError err = new HttpError(message); return(Request.CreateResponse(HttpStatusCode.NotFound, err)); } else { return(Request.CreateResponse(HttpStatusCode.OK, hs)); } }
public TotalsPage(GetStats stats) { InitializeComponent(); WinsTotal.Text = stats.totals.wins.ToString(); WinrateTotal.Text = stats.totals.winrate.ToString() + "%"; MatchesPlayedTotal.Text = stats.totals.matchesplayed.ToString(); ScoreTotal.Text = stats.totals.score.ToString(); KillsTotal.Text = stats.totals.kills.ToString(); KDTotal.Text = stats.totals.kd.ToString(); double hours = Convert.ToDouble(stats.totals.hoursplayed + stats.totals.minutesplayed / 60.0); if (hours < 1) { HoursPlayedTotal.Text = "Data Error"; } else { HoursPlayedTotal.Text = hours.ToString(); } }
public SoloDuoSquadPage(string mode, GetStats stats) { InitializeComponent(); Title = mode; double hours; if (mode == "Solo") { Top1.Text = stats.stats.placetop1_solo.ToString(); Top2.Text = stats.stats.placetop10_solo.ToString(); Top2Text.Text = "Top 10"; Top3.Text = stats.stats.placetop25_solo.ToString(); Top3Text.Text = "Top 25"; kills.Text = stats.stats.kills_solo.ToString(); winrate.Text = stats.stats.winrate_solo.ToString() + "%"; KD.Text = stats.stats.kd_solo.ToString(); MatchesPlayed.Text = stats.stats.matchesplayed_solo.ToString(); hours = stats.stats.minutesplayed_solo / 60.0; if (hours < 1) { HoursPlayed.Text = "Data Error"; } else { HoursPlayed.Text = (hours).ToString(); } Score.Text = stats.stats.score_solo.ToString(); } else if (mode == "Duo") { Top1.Text = stats.stats.placetop1_duo.ToString(); Top2.Text = stats.stats.placetop5_duo.ToString(); Top2Text.Text = "Top 5"; Top3.Text = stats.stats.placetop12_duo.ToString(); Top3Text.Text = "Top 12"; kills.Text = stats.stats.kills_duo.ToString(); winrate.Text = stats.stats.winrate_duo.ToString() + "%"; KD.Text = stats.stats.kd_duo.ToString(); MatchesPlayed.Text = stats.stats.matchesplayed_duo.ToString(); hours = stats.stats.minutesplayed_duo / 60.0; if (hours < 1) { HoursPlayed.Text = "Data Error"; } else { HoursPlayed.Text = (hours).ToString(); } Score.Text = stats.stats.score_duo.ToString(); } else { Top1.Text = stats.stats.placetop1_squad.ToString(); Top2.Text = stats.stats.placetop3_squad.ToString(); Top2Text.Text = "Top 3"; Top3.Text = stats.stats.placetop6_squad.ToString(); Top3Text.Text = "Top 6"; kills.Text = stats.stats.kills_squad.ToString(); winrate.Text = stats.stats.winrate_squad.ToString() + "%"; KD.Text = stats.stats.kd_squad.ToString(); MatchesPlayed.Text = stats.stats.matchesplayed_squad.ToString(); hours = stats.stats.minutesplayed_squad / 60.0; if (hours < 1) { HoursPlayed.Text = "Data Error"; } else { HoursPlayed.Text = (hours).ToString(); } Score.Text = stats.stats.score_squad.ToString(); } }
public static void Main(string[] args) { GetStats.DoWork(); }
public string GetStats() { var getStats = new GetStats(null, this.party, this.itemPool); return(getStats.Execute()); }
public Stats(GetStats stats, List <String> favorites) { InitializeComponent(); statspublic = stats; user.Text = stats.username; //platformsList.ItemsSource = ; favoritespublic = favorites; if (favorites.Contains(stats.username)) { FavoriteToolbar.Icon = "starwhite.png"; } else { FavoriteToolbar.Icon = "starblack.png"; } //if(stats.platforms.Contains("pc")) // { // pc.IsVisible = true; // } // if(stats.platforms.Contains("ps4")) // { // ps4.IsVisible = true; // } // if(stats.platforms.Contains("xbox")) // { // xbox.IsVisible = true; // } //for (i = 0; i < stats.platforms.Count(); i++) //{ // PlatformsGrid.ColumnDefinitions.Add(new ColumnDefinition()); //} //for (i = 0; i < stats.platforms.Count(); i++) //{ // Grid.SetColumn(pc, i); //} #region Totals WinsTotal.Text = stats.totals.wins.ToString(); WinrateTotal.Text = stats.totals.winrate.ToString() + "%"; KillsTotal.Text = stats.totals.kills.ToString(); KDTotal.Text = stats.totals.kd.ToString(); #endregion #region Solos Top1solo.Text = stats.stats.placetop1_solo.ToString(); Top10solo.Text = stats.stats.placetop10_solo.ToString(); Killssolo.Text = stats.stats.kills_solo.ToString(); Winratesolo.Text = stats.stats.winrate_solo.ToString() + "%"; KDsolo.Text = stats.stats.kd_solo.ToString(); #endregion #region Duos Top1duo.Text = stats.stats.placetop1_duo.ToString(); Top5duo.Text = stats.stats.placetop5_duo.ToString(); Killsduo.Text = stats.stats.kills_duo.ToString(); Winrateduo.Text = stats.stats.winrate_duo.ToString() + "%"; KDduo.Text = stats.stats.kd_duo.ToString(); #endregion #region Squads Top1squad.Text = stats.stats.placetop1_squad.ToString(); Top3squad.Text = stats.stats.placetop3_squad.ToString(); Killssquad.Text = stats.stats.kills_squad.ToString(); Winratesquad.Text = stats.stats.winrate_squad.ToString() + "%"; KDsquad.Text = stats.stats.kd_squad.ToString(); #endregion }
public bool cast(Card card, List <GameObject> selectedTiles, List <GameObject> rangeTiles, GameObject user, BattleStatus battleStatus, GetStats turn) { targets = 0; if (turnSystem.GetBattleStatus() != battleStatus && turnSystem.currentTurn != turn && turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { if (turnSystem.currentTurn == player.GetComponent <GetStats>()) { gridGenerator.DestroyTiles(DestroyOption.selectedTiles, true, true); Debug.Log("Its not the right stage to play a card"); } return(false); } if (user.GetComponent <GetStats>().character.currentMana >= card.manaCost) { foreach (GameObject tile in selectedTiles) { foreach (GameObject tile1 in rangeTiles) { //Debug.Log($"{tile.transform.position.x} == {tile1.transform.position.x} && {tile.transform.position.z} == {tile1.transform.position.z} "); if (tile.transform.position.x == tile1.transform.position.x && tile.transform.position.z == tile1.transform.position.z) { parametersObjects.Add(user); parametersObjects.Add(tile); skillInfo.SetCardID(card); user.GetComponent <GetStats>().lastcastedSkill = card; this.SendMessage(card.skill.ToString(), parametersObjects); targets++; if (targets >= card.maxAmountOfTargets) { return(true); } } } } if (targets == 0) { if (turnSystem.GetBattleStatus() != BattleStatus.Move && turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { Debug.Log("Select valid targets"); gridGenerator.DestroyTiles(DestroyOption.all, true, true); } return(false); } } else { if (turnSystem.currentTurn == cardSystem.Player.GetComponent <GetStats>()) { Debug.Log("You dont have enough mana for this ability"); } return(false); } return(false); }
public void RefreshOrder() { lastTurn = currentTurn; currentTurn = turnOrder[currentTurnIndex]; }