public void getTensAndXs(string endNum) { if (endNum == "Xs: ") { arrow1 = TensAndXs.GetXs(); } if (endNum == "10s: ") { arrow1 = TensAndXs.GetTens(); } }
public int Calc(string score, string r) { int current = 0; //current score for three total int curScr = 0; // new arrow score int prvScr = 0; // previous arrow score if (score == "X" || score == "x" || score == "10") { curScr = 10; if (score == "X" || score == "x") { TensAndXs.Xs();//increases count of Xs by one } else { TensAndXs.Tens();//increases count of 10s by one } } else { bool valid = int.TryParse(score, out curScr); if (UIComp720.ID != -1)//stops it firing on set-up { if (valid == false) { if (score != "M") { if (score != "m") { UIComp720.NotValid(score); score = "0"; } } } else { if (curScr > 10 || curScr < 0) { curScr = 0; score = "0"; UIComp720.NotValid(score); } } } } if (r == "X" || r == "x" || r == "10") { prvScr = 10; if (r == "X" || r == "x") { TensAndXs.RemoveXs();//decreases count of Xs by one } else { TensAndXs.RemoveTens();//decreases count of 10s by one } } else { int.TryParse(r, out prvScr); //returns 0 if not parsable, so M's are captured. if (prvScr > 10 || prvScr < 0) { prvScr = 0; } } current = this.threeTotal + curScr - prvScr; // minus prvScr to allow scores to be changed in case of user error runningTotal = calcRTComp.runningTotal(curScr, prvScr); endTotal = calcEndTotal.CalcEnd(curScr, prvScr, eR); return(current); }