1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
@ManagedBean
@SessionScoped
public class TableBean implements SessionBean, Serializable{
@EJB
private JeuFacadeLocal jeuFacade;
@EJB
private JoueurFacadeLocal joueurFacade;
@EJB
private TypeJeuFacadeLocal typejeuFacade;
private int i_nbJoueursEffectif;
private int i_nbJoueursRequis;
private int i_joueurId;
private String s_loginJoueur;
private Jeu o_jeu;
private Joueur o_joueur;
public TableBean() {
}
public void setBigBlind()
{
// On récupère le tapis du joueur et la somme à payer :
int i_tapisJoueur = o_joueur.getJou_tapis();
int i_bigBlind = o_jeu.getJeu_small() * 2;
// Si le joueur a assez pour payer la grosse blind (2 fois la petite) :
if(i_tapisJoueur >= i_bigBlind)
{
// Il paie cette blind :
o_joueur.setJou_big(i_bigBlind);
o_joueur.setJou_tapis(i_tapisJoueur - i_bigBlind);
}
// Sinon :
else
{
// Sa blind vaut son tapis :
o_joueur.setJou_big(i_tapisJoueur);
o_joueur.setJou_tapis(0);
}
this.joueurFacade.enregistrerJoueur(o_joueur);
}
public JeuFacadeLocal getJeuFacade() {
return jeuFacade;
}
public void setJeuFacade(JeuFacadeLocal jeuFacade) {
this.jeuFacade = jeuFacade;
}
public int getI_nbJoueursEffectif() {
return i_nbJoueursEffectif;
}
public void setI_nbJoueursEffectif(int i_nbJoueursEffectif) {
this.i_nbJoueursEffectif = i_nbJoueursEffectif;
}
public int getI_nbJoueursRequis() {
return i_nbJoueursRequis;
}
public void setI_nbJoueursRequis(int i_nbJoueursRequis) {
this.i_nbJoueursRequis = i_nbJoueursRequis;
}
public String getS_loginJoueur() {
return s_loginJoueur;
}
public void setS_loginJoueur(String s_loginJoueur) {
this.s_loginJoueur = s_loginJoueur;
}
public int getI_joueurId() {
return i_joueurId;
}
public void setI_joueurId(int i_joueurId) {
this.i_joueurId = i_joueurId;
}
public Joueur getO_joueur() {
return o_joueur;
}
public void setO_joueur(Joueur o_joueur) {
this.o_joueur = o_joueur;
}
@Override
public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void ejbRemove() throws EJBException, RemoteException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void ejbActivate() throws EJBException, RemoteException {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void ejbPassivate() throws EJBException, RemoteException {
throw new UnsupportedOperationException("Not supported yet.");
}
} |
Partager