Ejemplo n.º 1
0
        public Batter()
        {
            statGame = new BatterStats();
            statGame.Reset();

            statSeason = new BatterStats();
            statSeason.Reset();
        }
Ejemplo n.º 2
0
        public Batter(BattingSide side, int onBase, Position primary, int priRating, Position secondary, 
						 int secRating, int speed, int points, string results, string name)
            : base(points, results, name)
        {
            secondaryRating = secRating;
            secondaryPosition = secondary;
            primaryPosition = primary;
            primaryRating = priRating;
            this.onBase = onBase;
            this.speed = speed;
            battingSide = side;

            statGame = new BatterStats();
            statGame.Reset();

            statSeason = new BatterStats();
            statSeason.Reset();
        }
Ejemplo n.º 3
0
        public Batter(DataRow row, DataRow statRow, DataRow skillRow)
        {
            ID = Int32.Parse(row["player_id"].ToString());

            SetResults(row["results"].ToString());

            LoadCardInfo(ID);

            Name = row["name"].ToString();
            Points = Int32.Parse(row["points"].ToString());

            primaryPosition = (Position)Int32.Parse(skillRow["primary_position"].ToString());
            primaryRating = Int32.Parse(skillRow["primary_rating"].ToString());

            secondaryPosition = (Position)Int32.Parse(skillRow["secondary_position"].ToString());
            secondaryRating = Int32.Parse(skillRow["secondary_rating"].ToString());

            speed = Int32.Parse(skillRow["speed"].ToString());
            onBase = Int32.Parse(skillRow["on_base"].ToString());

            battingSide = (BattingSide)Int32.Parse(skillRow["batting_side"].ToString());

            //get stats
            statGame = new BatterStats();
            statGame.Reset();

            statSeason = new BatterStats();
            statSeason.Reset();

            statSeason.AtBats = short.Parse(statRow["atbats"].ToString());
            statSeason.Hits = short.Parse(statRow["hits"].ToString());
            statSeason.Doubles = short.Parse(statRow["doubles"].ToString());
            statSeason.Triples = short.Parse(statRow["triples"].ToString());
            statSeason.HomeRuns = short.Parse(statRow["homeruns"].ToString());
            statSeason.Walks = short.Parse(statRow["walks"].ToString());
            statSeason.Steals = short.Parse(statRow["steals"].ToString());
            statSeason.SacFlies = short.Parse(statRow["sacflies"].ToString());
            statSeason.SacBunts = short.Parse(statRow["sacbunts"].ToString());
            statSeason.HomeRuns = short.Parse(statRow["homeruns"].ToString());
            statSeason.StrikeOuts = short.Parse(statRow["strikeouts"].ToString());
            statSeason.RunsScored = short.Parse(statRow["runs"].ToString());
            statSeason.RBIs = short.Parse(statRow["rbis"].ToString());
            statSeason.Games = short.Parse(statRow["games"].ToString());
        }
Ejemplo n.º 4
0
        public Batter(DataRow row)
        {
            DataTable table;
            DataRow statRow;

            ID = Int32.Parse(row["player_id"].ToString());

            SetResults(row["results"].ToString());

            LoadCardInfo(ID);

            Name = row["name"].ToString();
            Points = Int32.Parse(row["points"].ToString());

            // get skills
            table = DbUtils.GetDataTable(string.Format("select * from batting_skill where player_id = {0}", ID));

            if (table.Rows.Count > 0) // just use the first row, should only be one
            {
                statRow = table.Rows[0];
                primaryPosition = (Position)Int32.Parse(statRow["primary_position"].ToString());
                primaryRating = Int32.Parse(statRow["primary_rating"].ToString());

                secondaryPosition = (Position)Int32.Parse(statRow["secondary_position"].ToString());
                secondaryRating = Int32.Parse(statRow["secondary_rating"].ToString());

                speed = Int32.Parse(statRow["speed"].ToString());
                onBase = Int32.Parse(statRow["on_base"].ToString());

                battingSide = (BattingSide)Int32.Parse(statRow["batting_side"].ToString());
            }

            //get stats
            statGame = new BatterStats();
            statGame.Reset();

            table = DbUtils.GetDataTable(string.Format("select * from batter_stats where player_id = {0}", ID));
            statSeason = new BatterStats();
            statSeason.Reset();

            if (table.Rows.Count > 0) // just use the first row, should only be one
            {
                statRow = table.Rows[0];

                statSeason.AtBats = short.Parse(statRow["atbats"].ToString());
                statSeason.Hits = short.Parse(statRow["hits"].ToString());
                statSeason.Doubles = short.Parse(statRow["doubles"].ToString());
                statSeason.Triples = short.Parse(statRow["triples"].ToString());
                statSeason.HomeRuns = short.Parse(statRow["homeruns"].ToString());
                statSeason.Walks = short.Parse(statRow["walks"].ToString());
                statSeason.Steals = short.Parse(statRow["steals"].ToString());
                statSeason.SacFlies = short.Parse(statRow["sacflies"].ToString());
                statSeason.SacBunts = short.Parse(statRow["sacbunts"].ToString());
                statSeason.HomeRuns = short.Parse(statRow["homeruns"].ToString());
                statSeason.StrikeOuts = short.Parse(statRow["strikeouts"].ToString());
                statSeason.RunsScored = short.Parse(statRow["runs"].ToString());
                statSeason.RBIs = short.Parse(statRow["rbis"].ToString());
                statSeason.Games = short.Parse(statRow["games"].ToString());
            }
        }