You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.2 KiB
34 lines
1.2 KiB
namespace CoreLibrary
|
|
{
|
|
/// <summary>
|
|
/// Class plateau qui initialise deux tableaux à 12.
|
|
/// Il a deux methodes une pour ajouter une combinaison dans le tableaux et une autres pour verifier si le tableau est plein.
|
|
/// </summary>
|
|
public class Plateau
|
|
{
|
|
private static readonly int tailleMax = 12;
|
|
private CombinaisonSecrete combinaisonSecrete = new CombinaisonSecrete();
|
|
private CombinaisonJoueur[] lesCombinaisonsJoueur = new CombinaisonJoueur[tailleMax];
|
|
private CombinaisonIndicateur[] lesCombinaisonsIndicateur = new CombinaisonIndicateur[tailleMax];
|
|
private int index = 0;
|
|
public bool AjouterCombinaison(CombinaisonJoueur combinaisonJoueur)
|
|
{
|
|
if (estComplet() == false)
|
|
{
|
|
lesCombinaisonsJoueur[index] = combinaisonJoueur;
|
|
index++;
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("Le plateau est plein, impossible d'ajouter une combinaison supplémentaire.");
|
|
}
|
|
}
|
|
|
|
public bool estComplet()
|
|
{
|
|
return index >= tailleMax;
|
|
}
|
|
}
|
|
}
|