Mobile-DARTS  1.1
BTS SNIR LaSalle Avignon 2021
TypeJeu.java
Aller à la documentation de ce fichier.
1 package com.lasalle84.mobile_darts;
2 
3 import android.util.Log;
4 
17 public class TypeJeu
18 {
22  private final static int PARTIE_301 = 0;
23  private final static int PARTIE_301_DOUBLE_OUT = 1;
24  private final static int PARTIE_501 = 2;
25  private final static int PARTIE_501_DOUBLE_OUT = 3;
26  private final static String TAG = "_TypeJeu_";
27 
31  private boolean doubleOut;
32  private int pointDepart;
33 
39  public TypeJeu()
40  {
41  this.pointDepart = 501;
42  this.doubleOut = true;
43  }
44 
50  public TypeJeu(int pointDepart, boolean doubleOut)
51  {
52  this.pointDepart = pointDepart;
53  this.doubleOut = doubleOut;
54  }
55 
56  public TypeJeu(int idModeJeu)
57  {
58  switch (idModeJeu)
59  {
60  case PARTIE_301:
61  this.pointDepart = 301;
62  this.doubleOut = false;
63  break;
65  this.pointDepart = 301;
66  this.doubleOut = true;
67  break;
68  case PARTIE_501:
69  this.pointDepart = 501;
70  this.doubleOut = false;
71  break;
73  this.pointDepart = 501;
74  this.doubleOut = true;
75  break;
76  }
77  }
78 
79  public int getPointDepart()
80  {
81  return pointDepart;
82  }
83 
84  public void setPointDepart(int pointDepart)
85  {
86  this.pointDepart = pointDepart;
87  }
88 
89  public boolean estDoubleOut()
90  {
91  return doubleOut;
92  }
93 
94  public void setDoubleOut(boolean doubleOut)
95  {
96  this.doubleOut = doubleOut;
97  }
98 
99  public String getTypeJeu()
100  {
101  String typeJeu = Integer.toString(this.getPointDepart());
102  if (doubleOut)
103  {
104  typeJeu = typeJeu.concat("_DOUBLE_OUT");
105  }
106  Log.d(TAG, "getTypeJeu: "+ typeJeu);
107  return typeJeu;
108 
109  }
110 }
static final int PARTIE_501_DOUBLE_OUT
Definition: TypeJeu.java:25
static final int PARTIE_301_DOUBLE_OUT
Definition: TypeJeu.java:23
void setPointDepart(int pointDepart)
Definition: TypeJeu.java:84
La classe qui contient toute la gestion des types de parties.
Definition: TypeJeu.java:17
void setDoubleOut(boolean doubleOut)
Definition: TypeJeu.java:94
TypeJeu()
Constructeur par défaut de la classe TypeJeu.
Definition: TypeJeu.java:39
TypeJeu(int pointDepart, boolean doubleOut)
Constructeur de la classe TypeJeu.
Definition: TypeJeu.java:50