public frame assignStrikeorSpare(frame frame) { if (frame.firstShoot == 10) { frame.strike = true; } if (frame.firstShoot + frame.secodshoot == 10 && frame.secodshoot != 0) { frame.spare = true; } return frame; }
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 scoreasign(List<int> jugadas) { if (jugadas.Count == 0) { MessageBox.Show("Wrong values, please select an autentic plays file"); close = true; return; } if (jugadas.Count >= 40 && jugadas.Count <= 42) { if (jugadas.Count > 40) { longgame = true; } int countplays = 0; frame frame; for (int i = 0; i < jugadas.Count; i++) { if (i < 36) { if (countplays == 0) { frame = new frame(); frame.firstShoot = jugadas[i]; i++; frame.secodshoot = jugadas[i]; playsPlayer1.Add(frame); countplays = 1; continue; } if (countplays == 1) { frame = new frame(); frame.firstShoot = jugadas[i]; i++; frame.secodshoot = jugadas[i]; playsPlayer2.Add(frame); countplays = 0; } } else { if (countplays == 0) { frame = new frame(); frame.firstShoot = jugadas[i]; i++; frame.secodshoot = jugadas[i]; i++; frame.thirthshoot = jugadas[i]; playsPlayer1.Add(frame); countplays = 1; continue; } if (countplays == 1) { frame = new frame(); frame.firstShoot = jugadas[i]; i++; frame.secodshoot = jugadas[i]; i++; frame.thirthshoot = jugadas[i]; playsPlayer2.Add(frame); countplays = 0; } } } } else { MessageBox.Show("this is not a full game, please select a full game"); close = true; return; } }