Projet Darts  0.2
BTS SNIR LaSalle Avignon 2020
TypeJeu.java
Aller à la documentation de ce fichier.
1 package projet.lasalle84.darts;
2 
9 import android.util.Log;
10 
15 public class TypeJeu
16 {
20  private boolean doubleOut;
21  private int pointDepart;
22 
26  private final static int PARTIE_501 = 0;
27  private final static int PARTIE_501_DOUBLE_OUT = 1;
28  private final static int PARTIE_301 = 2;
29  private final static int PARTIE_301_DOUBLE_OUT = 3;
30  private final static String TAG = "TypeJeu";
31 
38  public TypeJeu()
39  {
40  this.pointDepart = 501;
41  this.doubleOut = true;
42  }
43 
51  public TypeJeu(int pointDepart, boolean doubleOut)
52  {
53  this.pointDepart = pointDepart;
54  this.doubleOut = doubleOut;
55  }
56 
63  public TypeJeu(int idModeJeu)
64  {
65  switch (idModeJeu)
66  {
67  case PARTIE_501:
68  this.pointDepart = 501;
69  this.doubleOut = false;
70  break;
72  this.pointDepart = 501;
73  this.doubleOut = true;
74  break;
75  case PARTIE_301:
76  this.pointDepart = 301;
77  this.doubleOut = false;
78  break;
80  this.pointDepart = 301;
81  this.doubleOut = true;
82  break;
83 
84  }
85  }
86  public int getPointDepart()
87  {
88  return pointDepart;
89  }
90 
91  public void setPointDepart(int pointDepart)
92  {
93  this.pointDepart = pointDepart;
94  }
95 
96  public boolean estDoubleOut()
97  {
98  return doubleOut;
99  }
100 
101  public void setDoubleOut(boolean doubleOut)
102  {
103  this.doubleOut = doubleOut;
104  }
105 
106  public String getTypeJeu()
107  {
108  String typeJeu = Integer.toString(this.getPointDepart());
109  if (doubleOut)
110  {
111  typeJeu = typeJeu.concat("_DOUBLE_OUT");
112  }
113  Log.d(TAG, "getTypeJeu: "+ typeJeu);
114  return typeJeu;
115 
116  }
117 }
static final String TAG
Definition: TypeJeu.java:30
void setPointDepart(int pointDepart)
Definition: TypeJeu.java:91
TypeJeu(int pointDepart, boolean doubleOut)
Constructeur de la classe TypeJeu.
Definition: TypeJeu.java:51
static final int PARTIE_301
Definition: TypeJeu.java:28
TypeJeu()
Constructeur par défaut de la classe TypeJeu.
Definition: TypeJeu.java:38
void setDoubleOut(boolean doubleOut)
Definition: TypeJeu.java:101
Déclaration de la classe TypeJeu.
Definition: TypeJeu.java:15
static final int PARTIE_301_DOUBLE_OUT
Definition: TypeJeu.java:29
static final int PARTIE_501
Definition: TypeJeu.java:26
boolean doubleOut
Le mode est en Double Out ?
Definition: TypeJeu.java:20
TypeJeu(int idModeJeu)
Constructeur de la classe TypeJeu.
Definition: TypeJeu.java:63
static final int PARTIE_501_DOUBLE_OUT
Definition: TypeJeu.java:27
int pointDepart
Point de depart du mode de jeu.
Definition: TypeJeu.java:21