public MLBPitch(XElement pitch) { switch(pitch.Attribute("type").Value.ToString()) { case "S": result = PitchResult.Strike; break; case "B": result = PitchResult.Ball; break; case "X": result = PitchResult.InPlay; break; } desc = pitch.Attribute("des").Value.ToString(); px = Convert.ToSingle(pitch.Attribute("px").Value); pz = Convert.ToSingle(pitch.Attribute("pz").Value); top_of_zone = Convert.ToSingle(pitch.Attribute("sz_top").Value); bottom_of_zone = Convert.ToSingle(pitch.Attribute("sz_bot").Value); if (pitch.Attribute("start_speed") != null) speed = Convert.ToSingle(pitch.Attribute("start_speed").Value); else speed = 0; num = Convert.ToInt32(pitch.Attribute("id").Value); }
public StereoPitchResult(PitchResult leftResult, PitchResult rightResult, int bytesRead) { Left = leftResult; Right = rightResult; this.bytesRead = bytesRead; }