|
|
|
@ -18,8 +18,8 @@
|
|
|
|
|
|
|
|
|
|
public void AjouterJeton(Jeton jeton)
|
|
|
|
|
{
|
|
|
|
|
if (NbJetons >= TailleMaximale() )
|
|
|
|
|
throw new CodeTailleTableauLesJetonsException();
|
|
|
|
|
if (EstComplet())
|
|
|
|
|
throw new CodeTailleTableauLesJetonsCompletException();
|
|
|
|
|
|
|
|
|
|
lesJetons[NbJetons++] = jeton;
|
|
|
|
|
}
|
|
|
|
@ -27,7 +27,7 @@
|
|
|
|
|
public void SupprimerDernierJeton()
|
|
|
|
|
{
|
|
|
|
|
if(NbJetons <= 0)
|
|
|
|
|
throw new CodeTailleTableauLesJetonsException();
|
|
|
|
|
throw new CodeTableauLesJetonsVideException();
|
|
|
|
|
|
|
|
|
|
lesJetons[NbJetons--] = null;
|
|
|
|
|
}
|
|
|
|
@ -35,12 +35,12 @@
|
|
|
|
|
public Jeton RecupererJeton(int indice)
|
|
|
|
|
{
|
|
|
|
|
if(indice < 0 || indice > TailleMaximale())
|
|
|
|
|
throw new CodeIndiceInvalideException();
|
|
|
|
|
throw new CodeIndiceHorsDePortéeException();
|
|
|
|
|
|
|
|
|
|
Jeton? jeton = lesJetons[indice];
|
|
|
|
|
|
|
|
|
|
if (!jeton.HasValue)
|
|
|
|
|
throw new CodeJetonInvalideException();
|
|
|
|
|
throw new CodeJetonNullException();
|
|
|
|
|
|
|
|
|
|
return jeton.Value;
|
|
|
|
|
}
|
|
|
|
@ -63,8 +63,8 @@
|
|
|
|
|
public IEnumerable<Indicateur> Comparer(Code autreCode)
|
|
|
|
|
{
|
|
|
|
|
// Mon code est le code correct, l'autre code est celui qui teste
|
|
|
|
|
if (autreCode.NbJetons <= TailleMaximale() )
|
|
|
|
|
throw new CodeTailleTableauLesJetonsException();
|
|
|
|
|
if (!autreCode.EstComplet())
|
|
|
|
|
throw new CodeTailleTableauLesJetonsCompletException();
|
|
|
|
|
|
|
|
|
|
Indicateur[] indicateurs = [];
|
|
|
|
|
|
|
|
|
|