public List <string> RecupPrecedent() { List <string> ListDecisionPrec = new List <string>(); string sel = "select * from toursParole where num_Partie = " + PA.Numero + " and num_main=" + PA.Numero_Main + " and NomEtape= '" + PA.Etape + "' and num_tour = " + (PA.Num_Tour - 1); DataSet dsTours = maBD.Recuperer(sel); DataTable tableToursParole = dsTours.Tables[0]; TourParole tourPrec = new TourParole(tableToursParole.Rows[0]); ListDecisionPrec.Add(tourPrec.Dec_J0); ListDecisionPrec.Add(tourPrec.Dec_J1); ListDecisionPrec.Add(tourPrec.Dec_J2); ListDecisionPrec.Add(tourPrec.Dec_J3); ListDecisionPrec.Add(tourPrec.Dec_J4); ListDecisionPrec.Add(tourPrec.Dec_J5); return(ListDecisionPrec); }
public bool Terminee() { string sel = "select dec_j0, dec_j1, dec_j2, dec_j3, dec_j4, dec_j5 from toursParole " + " where num_partie= " + PA.Numero + " and " + " num_main =" + PA.Numero_Main + " and " + " Nometape = '" + PA.Etape + "'" + " and " + " num_tour = " + PA.Num_Tour; TourParole tDeP = TG.SRV.Incarne <ToursParole_ADO_SRV>().RecupToursParole(); int NbSurvivant = 6; if (tDeP.Dec_J0 == "MORT" || tDeP.Dec_J0 == "MOURANT") { NbSurvivant--; } if (tDeP.Dec_J1 == "MORT" || tDeP.Dec_J1 == "MOURANT") { NbSurvivant--; } if (tDeP.Dec_J2 == "MORT" || tDeP.Dec_J2 == "MOURANT") { NbSurvivant--; } if (tDeP.Dec_J3 == "MORT" || tDeP.Dec_J3 == "MOURANT") { NbSurvivant--; } if (tDeP.Dec_J4 == "MORT" || tDeP.Dec_J4 == "MOURANT") { NbSurvivant--; } if (tDeP.Dec_J5 == "MORT" || tDeP.Dec_J5 == "MOURANT") { NbSurvivant--; } if (NbSurvivant == 1) { return(true); } return(false); }
private List <Joueur> AjouteJoueursDecision(List <Joueur> ljp, mainPartie mp) { if (mp == null) { mp = TG.SRV.Incarne <iMains_ADO_SRV>().RecupUneMain(); } if (mp.Etape != "POST_RIVER") { PA.Etape = mp.Etape; } Etape etapeCourante = TG.SRV.Incarne <Etapes_ADO_SRV>().RecupEtapeDuneMain(); PA.ProchainJoueur = etapeCourante.ProchainJoueur; PA.Num_Tour = etapeCourante.NumTour; TourParole tourParoleCourant = TG.SRV.Incarne <ToursParole_ADO_SRV>().RecupToursParole(); for (int i = 0; i < ljp.Count; i++) { if (i == 0) { ljp[0].Decision = tourParoleCourant.Dec_J0; ljp[0].DateDec = tourParoleCourant.Date_J0; ljp[0].Engagement = tourParoleCourant.Eng_J0; ljp[0].Capital = mp.CapitalFinJ0; } if (i == 1) { ljp[1].Decision = tourParoleCourant.Dec_J1; ljp[1].DateDec = tourParoleCourant.Date_J1; ljp[1].Engagement = tourParoleCourant.Eng_J1; ljp[1].Capital = mp.CapitalFinJ1; } if (i == 2) { ljp[2].Decision = tourParoleCourant.Dec_J2; ljp[2].DateDec = tourParoleCourant.Date_J2; ljp[2].Engagement = tourParoleCourant.Eng_J2; ljp[2].Capital = mp.CapitalFinJ2; } if (i == 3) { ljp[3].Decision = tourParoleCourant.Dec_J3; ljp[3].DateDec = tourParoleCourant.Date_J3; ljp[3].Engagement = tourParoleCourant.Eng_J3; ljp[3].Capital = mp.CapitalFinJ3; } if (i == 4) { ljp[4].Decision = tourParoleCourant.Dec_J4; ljp[4].DateDec = tourParoleCourant.Date_J4; ljp[4].Engagement = tourParoleCourant.Eng_J4; ljp[4].Capital = mp.CapitalFinJ4; } if (i == 5) { ljp[5].Decision = tourParoleCourant.Dec_J5; ljp[5].DateDec = tourParoleCourant.Date_J5; ljp[5].Engagement = tourParoleCourant.Eng_J5; ljp[5].Capital = mp.CapitalFinJ5; } } return(ljp); }