public BackgroundGameplay(string directory) { InitializeComponent(); getScore.scan(directory); this.player1 = getScore.Player1; this.player2 = getScore.Player2; }
public BackgroundGameplay(string directory) { InitializeComponent(); getScore.scan(directory); this.framesplayer1 = getScore.playsPlayer1; this.framesplayer2 = getScore.playsPlayer2; this.player1 = getScore.Player1; this.player2 = getScore.Player2; getallframestogether(framesplayer1, framesplayer2); }
public void ScoreDetectionok() { ScoreDetection sd = new ScoreDetection(); Player p1 = new Player(); Player p2 = new Player(); sd.Player1 = p1; sd.Player2 = p2; Assert.IsNotNull(p1); Assert.IsNotNull(p2); }
public frame getplay(int index, Player currentplayer) { frame sender = new frame(); switch (index) { case 1: sender = frame1(currentplayer, index); break; case 2: sender = frame1(currentplayer, index); break; case 3: sender = frame1(currentplayer, index); break; case 4: sender = frame1(currentplayer, index); break; case 5: sender = frame2(currentplayer, index); break; case 6: sender = frame2(currentplayer, index); break; case 7: sender = frame2(currentplayer, index); break; case 8: sender = frame2(currentplayer, index); break; case 9: sender = frame3(currentplayer, index); break; case 10: sender = frame3(currentplayer, index); break; case 11: sender = frame3(currentplayer, index); break; case 12: sender = frame3(currentplayer, index); break; case 13: sender = frame4(currentplayer, index); break; case 14: sender = frame4(currentplayer, index); break; case 15: sender = frame4(currentplayer, index); break; case 16: sender = frame4(currentplayer, index); break; case 17: sender = frame5(currentplayer, index); break; case 18: sender = frame5(currentplayer, index); break; case 19: sender = frame5(currentplayer, index); break; case 20: sender = frame5(currentplayer, index); break; case 21: sender = frame6(currentplayer, index); break; case 22: sender = frame6(currentplayer, index); break; case 23: sender = frame6(currentplayer, index); break; case 24: sender = frame6(currentplayer, index); break; case 25: sender = frame7(currentplayer, index); break; case 26: sender = frame7(currentplayer, index); break; case 27: sender = frame7(currentplayer, index); break; case 28: sender = frame7(currentplayer, index); break; case 29: sender = frame8(currentplayer, index); break; case 30: sender = frame8(currentplayer, index); break; case 31: sender = frame8(currentplayer, index); break; case 32: sender = frame8(currentplayer, index); break; case 33: sender = frame9(currentplayer, index); break; case 34: sender = frame9(currentplayer, index); break; case 35: sender = frame9(currentplayer, index); break; case 36: sender = frame9(currentplayer, index); break; case 37: sender = frame10(currentplayer, index); break; case 38: sender = frame10(currentplayer, index); break; case 39: sender = frame10(currentplayer, index); break; case 40: sender = frame10(currentplayer, index); break; case 41: sender = frame10(currentplayer, index); break; case 42: sender = frame10(currentplayer, index); break; } return sender; }
public frame frame9(Player currentplayer, int index) { frame frame = new frame(); return frame; }
public void God(Player player,int currentframe) { int whatever = 0; switch (currentframe) { case 1: if (player.Frame1.strike == true) { if (player.Frame2.strike == true) { whatever = player.Frame1.firstShoot + player.Frame2.firstShoot + player.Frame3.firstShoot; player.Frame1.showinframe = 4; } else { whatever = player.Frame1.firstShoot + player.Frame2.firstShoot + player.Frame2.secodshoot; player.Frame1.showinframe = 3; } } if (player.Frame1.spare == true) { whatever = player.Frame1.firstShoot + player.Frame1.secodshoot + player.Frame2.firstShoot; player.Frame1.showinframe = 3; } if (player.Frame1.strike == false && player.Frame1.spare == false) { whatever = player.Frame1.firstShoot + player.Frame1.secodshoot; player.Frame1.showinframe = 2; } player.Frame1.framescore = whatever; break; case 2: if (player.Frame2.strike == true) { if (player.Frame3.strike == true) { whatever = player.Frame2.firstShoot + player.Frame3.firstShoot + player.Frame4.firstShoot; player.Frame2.showinframe = 5; } else { whatever = player.Frame2.firstShoot + player.Frame3.firstShoot + player.Frame3.secodshoot; player.Frame2.showinframe = 4; } } if (player.Frame2.spare == true) { whatever = player.Frame2.firstShoot + player.Frame2.secodshoot + player.Frame3.firstShoot; player.Frame2.showinframe = 4; } if (player.Frame2.strike == false && player.Frame2.spare == false) { whatever = player.Frame2.firstShoot + player.Frame2.secodshoot; player.Frame2.showinframe = 3; } player.Frame2.framescore = whatever; break; case 3: if (player.Frame3.strike == true) { if (player.Frame4.strike == true) { whatever = player.Frame3.firstShoot + player.Frame4.firstShoot + player.Frame5.firstShoot; player.Frame3.showinframe = 6; } else { whatever = player.Frame3.firstShoot + player.Frame4.firstShoot + player.Frame4.secodshoot; player.Frame3.showinframe = 5; } } if (player.Frame3.spare == true) { whatever = player.Frame3.firstShoot + player.Frame3.secodshoot + player.Frame4.firstShoot; player.Frame3.showinframe = 5; } if (player.Frame3.strike == false && player.Frame3.spare == false) { whatever = player.Frame3.firstShoot + player.Frame3.secodshoot; player.Frame3.showinframe = 4; } player.Frame3.framescore = whatever; break; case 4: if (player.Frame4.strike == true) { if (player.Frame5.strike == true) { whatever = player.Frame4.firstShoot + player.Frame5.firstShoot + player.Frame6.firstShoot; player.Frame4.showinframe = 7; } else { whatever = player.Frame4.firstShoot + player.Frame5.firstShoot + player.Frame5.secodshoot; player.Frame4.showinframe = 6; } } if (player.Frame4.spare == true) { whatever = player.Frame4.firstShoot + player.Frame4.secodshoot + player.Frame5.firstShoot; player.Frame4.showinframe = 6; } if (player.Frame4.strike == false && player.Frame4.spare == false) { whatever = player.Frame4.firstShoot + player.Frame4.secodshoot; player.Frame4.showinframe = 5; } player.Frame4.framescore = whatever; break; case 5: if (player.Frame5.strike == true) { if (player.Frame6.strike == true) { whatever = player.Frame5.firstShoot + player.Frame6.firstShoot + player.Frame7.firstShoot; player.Frame5.showinframe = 8; } else { whatever = player.Frame5.firstShoot + player.Frame6.firstShoot + player.Frame6.secodshoot; player.Frame5.showinframe = 7; } } if (player.Frame5.spare == true) { whatever = player.Frame5.firstShoot + player.Frame5.secodshoot + player.Frame6.firstShoot; player.Frame5.showinframe = 7; } if (player.Frame5.strike == false && player.Frame5.spare == false) { whatever = player.Frame5.firstShoot + player.Frame5.secodshoot; player.Frame5.showinframe = 6; } player.Frame5.framescore = whatever; break; case 6: if (player.Frame6.strike == true) { if (player.Frame7.strike == true) { whatever = player.Frame6.firstShoot + player.Frame7.firstShoot + player.Frame8.firstShoot; player.Frame6.showinframe = 9; } else { whatever = player.Frame6.firstShoot + player.Frame7.firstShoot + player.Frame7.secodshoot; player.Frame6.showinframe = 8; } } if (player.Frame6.spare == true) { whatever = player.Frame6.firstShoot + player.Frame6.secodshoot + player.Frame7.firstShoot; player.Frame6.showinframe = 8; } if (player.Frame6.strike == false && player.Frame6.spare == false) { whatever = player.Frame6.firstShoot + player.Frame6.secodshoot; player.Frame6.showinframe = 7; } player.Frame6.framescore = whatever; break; case 7: if (player.Frame7.strike == true) { if (player.Frame8.strike == true) { whatever = player.Frame7.firstShoot + player.Frame8.firstShoot + player.Frame9.firstShoot; player.Frame7.showinframe = 10; } else { whatever = player.Frame7.firstShoot + player.Frame8.firstShoot + player.Frame8.secodshoot; player.Frame7.showinframe = 9; } } if (player.Frame7.spare == true) { whatever = player.Frame7.firstShoot + player.Frame7.secodshoot + player.Frame8.firstShoot; player.Frame7.showinframe = 9; } if (player.Frame7.strike == false && player.Frame7.spare == false) { whatever = player.Frame7.firstShoot + player.Frame7.secodshoot; player.Frame7.showinframe = 8; } player.Frame7.framescore = whatever; break; case 8: if (player.Frame8.strike == true) { if (player.Frame9.strike == true) { whatever = player.Frame8.firstShoot + player.Frame9.firstShoot + player.Frame10.firstShoot; player.Frame8.showinframe = 10; } else { whatever = player.Frame8.firstShoot + player.Frame9.firstShoot + player.Frame9.secodshoot; player.Frame8.showinframe = 10; } } if (player.Frame8.spare == true) { whatever = player.Frame8.firstShoot + player.Frame8.secodshoot + player.Frame9.firstShoot; player.Frame8.showinframe = 10; } if (player.Frame8.strike == false && player.Frame8.spare == false) { whatever = player.Frame8.firstShoot + player.Frame8.secodshoot; player.Frame8.showinframe = 9; } player.Frame8.framescore = whatever;break; case 9: if (player.Frame9.strike == true) { if (player.Frame10.strike == true) { whatever = player.Frame9.firstShoot + player.Frame10.firstShoot + player.Frame10.secodshoot; player.Frame9.showinframe = 10; } else { whatever = player.Frame9.firstShoot + player.Frame10.firstShoot + player.Frame10.secodshoot; player.Frame9.showinframe = 10; } } if (player.Frame9.spare == true) { whatever = player.Frame9.firstShoot + player.Frame9.secodshoot + player.Frame10.firstShoot; player.Frame9.showinframe = 10; } if (player.Frame9.strike == false && player.Frame9.spare == false) { whatever = player.Frame9.firstShoot + player.Frame9.secodshoot; player.Frame9.showinframe = 10; } player.Frame9.framescore = whatever;break; case 10: if (player.Frame10.strike == true) { whatever = player.Frame10.firstShoot + player.Frame10.secodshoot + player.Frame10.thirdshoot; player.Frame10.showinframe = 11; } if (player.Frame10.spare == true) { whatever = player.Frame10.firstShoot + player.Frame10.secodshoot + player.Frame10.thirdshoot; player.Frame10.showinframe = 11; } if (player.Frame10.strike == false && player.Frame10.spare == false) { whatever = player.Frame10.firstShoot + player.Frame10.secodshoot; player.Frame10.showinframe = 11; } player.Frame10.framescore = whatever; break; } }