public void Init() { string[] s_races = new string[] { "Abathur", "Alarak", "Artanis", "Dehaka", "Fenix", "Horner", "Karax", "Kerrigan", "Nova", "Raynor", "Stukov", "Swann", "Tychus", "Vorazun", "Zagara", "Protoss", "Terran", "Zerg" }; List <dsstats_race> list = new List <dsstats_race>(); foreach (string r in s_races) { dsstats_race cmdr = new dsstats_race(); cmdr.RACE = r; list.Add(cmdr); } this.VS = list; }
public override void AddGame(dsplayer pl, dsplayer opp) { dsstats_race cmdr = new dsstats_race(); cmdr = this.objRace(pl.RACE); this.GAMES++; cmdr.RGAMES++; cmdr.DPS += pl.GetDPS(); this.DPS += pl.GetDPS(); cmdr.DPM += pl.GetDPM(); this.DPM += pl.GetDPM(); cmdr.DPV += pl.GetDPV(); this.DPV += pl.GetDPV(); dsstats_vs cmdr_vs = new dsstats_vs(); cmdr_vs = cmdr.OPP; cmdr_vs.GAMES++; dsstats_race cmdr_opp = new dsstats_race(); cmdr_opp = cmdr_vs.objRaceVS(opp.RACE); cmdr_opp.RGAMES++; cmdr_opp.DPS += pl.GetDPS(); cmdr_opp.DPM += pl.GetDPM(); cmdr_opp.DPV += pl.GetDPV(); }
public dsstats_race objRaceVS(string cmdr) { dsstats_race race = new dsstats_race(); race = this.VS.Find(x => x.RACE == cmdr); return(race); }
public virtual dsstats_race objRace(string cmdr) { dsstats_race race = new dsstats_race(); race = this.LRACE.Find(x => x.RACE == cmdr); return(race); }
public double GetDURATION(string race) { double dur = 0; dsstats_race cmdr = new dsstats_race(); cmdr = VS.Find(x => x.RACE == race); dur = cmdr.GetDURATION(); return(dur); }
public override void AddWin(dsplayer pl, dsplayer opp) { dsstats_race cmdr = new dsstats_race(); cmdr = this.objRace(pl.RACE); this.WINS++; cmdr.RWINS++; dsstats_vs cmdr_vs = new dsstats_vs(); cmdr_vs = cmdr.OPP; cmdr_vs.WINS++; dsstats_race cmdr_opp = new dsstats_race(); cmdr_opp = cmdr_vs.objRaceVS(opp.RACE); cmdr_opp.RWINS++; }
public virtual void AddWin(dsplayer race, dsplayer opp_race) { dsstats_race cmdr = new dsstats_race(); cmdr = this.objRace(race.RACE); this.WINS++; cmdr.RWINS++; dsstats_vs cmdr_vs = new dsstats_vs(); cmdr_vs = cmdr.OPP; cmdr_vs.WINS++; dsstats_race cmdr_opp = new dsstats_race(); cmdr_opp = cmdr_vs.objRaceVS(opp_race.RACE); cmdr_opp.RWINS++; }
public virtual void AddGame(dsplayer race, dsplayer opp_race) { dsstats_race cmdr = new dsstats_race(); cmdr = this.objRace(race.RACE); this.GAMES++; cmdr.RGAMES++; cmdr.AddGame(race.PDURATION); dsstats_vs cmdr_vs = new dsstats_vs(); cmdr_vs = cmdr.OPP; cmdr_vs.GAMES++; dsstats_race cmdr_opp = new dsstats_race(); cmdr_opp = cmdr_vs.objRaceVS(opp_race.RACE); cmdr_opp.RGAMES++; cmdr_opp.AddGame(race.PDURATION); }
public Dictionary <string, List <KeyValuePair <string, double> > > GetSynList(List <string> cmdrs, List <dsreplay> replays) { var mylist = new Dictionary <string, List <KeyValuePair <string, double> > >(); dssynergy syn = new dssynergy(); dsstats_race synrace = new dsstats_race(); dssynergy antisyn = new dssynergy(); dsstats_race antisynrace = new dsstats_race(); foreach (dsreplay replay in replays) { if (replay.PLAYERCOUNT != 6) { continue; } foreach (dsplayer player in replay.PLAYERS) { syn.RACES[player.RACE].GAMES++; antisyn.RACES[player.RACE].GAMES++; List <dsplayer> teammates = new List <dsplayer>(replay.GetTeammates(player)); foreach (dsplayer teammate in teammates) { synrace = syn.RACES[player.RACE].objRace(teammate.RACE); synrace.RGAMES++; if (player.TEAM == replay.WINNER) { synrace.RWINS++; } } List <dsplayer> opponents = new List <dsplayer>(replay.GetOpponents(player)); foreach (dsplayer opponent in opponents) { antisynrace = antisyn.RACES[player.RACE].objRace(opponent.RACE); antisynrace.RGAMES++; if (player.TEAM == replay.WINNER) { antisynrace.RWINS++; } } } } foreach (string cmdr in cmdrs) { List <KeyValuePair <string, double> > synrow = new List <KeyValuePair <string, double> >(); List <KeyValuePair <string, double> > antisynrow = new List <KeyValuePair <string, double> >(); if (MW.cb_antisyn.IsChecked == false) { foreach (dsstats_race intsyn in syn.RACES[cmdr].LRACE) { double wr = intsyn.GetWR(); string syncmdr = intsyn.RACE; KeyValuePair <string, double> mystat = new KeyValuePair <string, double>(syncmdr, wr); if (MW.cb_std.IsChecked == false) { if (intsyn.RACE == "Protoss" || intsyn.RACE == "Terran" || intsyn.RACE == "Zerg") { continue; } } synrow.Add(mystat); } mylist.Add(key: cmdr, value: synrow); } else { foreach (dsstats_race intsyn in antisyn.RACES[cmdr].LRACE) { double wr = intsyn.GetWR(); string syncmdr = intsyn.RACE; KeyValuePair <string, double> mystat = new KeyValuePair <string, double>(syncmdr, wr); if (MW.cb_std.IsChecked == false) { if (intsyn.RACE == "Protoss" || intsyn.RACE == "Terran" || intsyn.RACE == "Zerg") { continue; } } antisynrow.Add(mystat); } mylist.Add(key: cmdr, value: antisynrow); } } return(mylist); }