Exemple #1
0
        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();
        }
Exemple #2
0
        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++;
        }
Exemple #3
0
        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++;
        }
Exemple #4
0
        public List <dsplayer> GetOpponents(dsplayer pl)
        {
            List <dsplayer> opponents = new List <dsplayer>();

            foreach (dsplayer tm in PLAYERS)
            {
                if (pl.POS == tm.POS)
                {
                    continue;
                }
                if (pl.TEAM != tm.TEAM)
                {
                    opponents.Add(tm);
                }
            }

            return(opponents);
        }
Exemple #5
0
        public List <dsplayer> GetTeammates(dsplayer pl)
        {
            List <dsplayer> teammates = new List <dsplayer>();

            foreach (dsplayer tm in PLAYERS)
            {
                if (pl.POS == tm.POS)
                {
                    continue;
                }
                if (pl.TEAM == tm.TEAM)
                {
                    teammates.Add(tm);
                }
            }

            return(teammates);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        public dsplayer GetOpp(int pos)
        {
            dsplayer plopp = new dsplayer();

            if (this.PLAYERCOUNT == 6)
            {
                if (pos == 1)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 4);
                }
                if (pos == 2)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 5);
                }
                if (pos == 3)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 6);
                }
                if (pos == 4)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 1);
                }
                if (pos == 5)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 2);
                }
                if (pos == 6)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 3);
                }
                //opp = plopp.RACE;
            }
            else if (this.PLAYERCOUNT == 4)
            {
                if (pos == 1)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 4);
                }
                if (pos == 2)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 5);
                }
                if (pos == 4)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 1);
                }
                if (pos == 5)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 2);
                }
            }
            else if (this.PLAYERCOUNT == 2)
            {
                if (pos == 1)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 4);
                }
                if (pos == 4)
                {
                    plopp = this.PLAYERS.Find(x => x.REALPOS == 1);
                }
            }
            if (plopp == null)
            {
                foreach (var ent in GetOpponents(this.PLAYERS.Find(x => x.REALPOS == pos)))
                {
                    plopp = ent;
                    break;
                }
            }
            if (plopp == null)
            {
                plopp = this.PLAYERS.Find(x => x.REALPOS == pos);
            }

            return(plopp);
        }