|
|
|
@ -18,20 +18,29 @@
|
|
|
|
|
|
|
|
|
|
public void AjouterJeton(Jeton jeton)
|
|
|
|
|
{
|
|
|
|
|
if (EstComplet())
|
|
|
|
|
throw new CodeTableauLesJetonsCompletException();
|
|
|
|
|
|
|
|
|
|
lesJetons[NbJetons++] = jeton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SupprimerDernierJeton()
|
|
|
|
|
{
|
|
|
|
|
if(NbJetons <= 0)
|
|
|
|
|
throw new CodeTableauLesJetonsVideException();
|
|
|
|
|
|
|
|
|
|
lesJetons[NbJetons--] = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Jeton RecupererJeton(int indice)
|
|
|
|
|
{
|
|
|
|
|
if(indice < 0 || indice > TailleMaximale())
|
|
|
|
|
throw new CodeIndiceHorsDePorteeException();
|
|
|
|
|
|
|
|
|
|
Jeton? jeton = lesJetons[indice];
|
|
|
|
|
|
|
|
|
|
if (!jeton.HasValue)
|
|
|
|
|
throw new Exception();
|
|
|
|
|
throw new CodeJetonNullException();
|
|
|
|
|
|
|
|
|
|
return jeton.Value;
|
|
|
|
|
}
|
|
|
|
@ -54,6 +63,8 @@
|
|
|
|
|
public IEnumerable<Indicateur> Comparer(Code autreCode)
|
|
|
|
|
{
|
|
|
|
|
// Mon code est le code correct, l'autre code est celui qui teste
|
|
|
|
|
if (!autreCode.EstComplet())
|
|
|
|
|
throw new CodeTableauLesJetonsIncompletException();
|
|
|
|
|
|
|
|
|
|
Indicateur[] indicateurs = [];
|
|
|
|
|
|
|
|
|
@ -100,3 +111,5 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|