Beispiel #1
0
        public Pitcher(DataRow row, DataRow statRow, DataRow skillRow)
        {
            ID = Int32.Parse(row["player_id"].ToString());

            LoadCardInfo(ID);

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

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

            // get skills
            control = Int32.Parse(skillRow["control"].ToString());
            pitcherRole = (PitcherType)Int32.Parse(skillRow["role"].ToString());
            inningsPitched = Int32.Parse(skillRow["innings"].ToString());
            pitchingArm = (ThrowingSide)Int32.Parse(skillRow["throwing_side"].ToString());

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

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

            statSeason.Runs = short.Parse(statRow["runs"].ToString());
            statSeason.Walks = short.Parse(statRow["walks"].ToString());
            statSeason.StrikeOuts = short.Parse(statRow["strikeouts"].ToString());
            statSeason.EarnedRuns = short.Parse(statRow["earned_runs"].ToString());
            statSeason.Outs = short.Parse(statRow["outs"].ToString());
            statSeason.Games = short.Parse(statRow["games"].ToString());
            statSeason.Wins = short.Parse(statRow["wins"].ToString());
            statSeason.Losses = short.Parse(statRow["losses"].ToString());
            statSeason.Saves = short.Parse(statRow["saves"].ToString());
        }
Beispiel #2
0
        public Pitcher()
        {
            statGame = new PitcherStats();
            statGame.Reset();

            statSeason = new PitcherStats();
            statSeason.Reset();
        }
Beispiel #3
0
        public Pitcher(int Control, int IP, ThrowingSide Arm, int Points, PitcherType Position, 
						   string Results, string Name)
            : base(Points, Results, Name)
        {
            control = Control;
            inningsPitched = IP;
            pitchingArm = Arm;
            pitcherRole = Position;

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

            statSeason = new PitcherStats();
            statSeason.Reset();
        }
Beispiel #4
0
        public Pitcher(DataRow row)
        {
            DataTable table;
            DataRow statRow;
            DataRow skillRow;

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

            LoadCardInfo(ID);

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

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

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

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

                control = Int32.Parse(skillRow["control"].ToString());
                pitcherRole = (PitcherType)Int32.Parse(skillRow["role"].ToString());
                inningsPitched = Int32.Parse(skillRow["innings"].ToString());
                pitchingArm = (ThrowingSide)Int32.Parse(skillRow["throwing_side"].ToString());
            }

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

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

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

                statSeason.Runs = short.Parse(statRow["runs"].ToString());
                statSeason.Walks = short.Parse(statRow["walks"].ToString());
                statSeason.StrikeOuts = short.Parse(statRow["strikeouts"].ToString());
                statSeason.EarnedRuns = short.Parse(statRow["earned_runs"].ToString());
                statSeason.Outs = short.Parse(statRow["outs"].ToString());
                statSeason.Games = short.Parse(statRow["games"].ToString());
                statSeason.Wins = short.Parse(statRow["wins"].ToString());
                statSeason.Losses = short.Parse(statRow["losses"].ToString());
                statSeason.Saves = short.Parse(statRow["saves"].ToString());
            }
        }