|
|
|
@ -1,20 +1,27 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace BibliothequeClasses
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <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 int tailleMax = 12;
|
|
|
|
|
private static readonly int tailleMax = 12;
|
|
|
|
|
private CombinaisonSecrete combinaisonSecrete = new CombinaisonSecrete();
|
|
|
|
|
private CombinaisonJoueur[] lesCombinaisonsJoueur = new CombinaisonJoueur[tailleMax];
|
|
|
|
|
private Combinaison[] lesCombinaisonsIndicateur = new CombinaisonIndicateur[tailleMax];
|
|
|
|
|
private int index = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool AjouterCombinaison(CombinaisonJoueur combinaisonJoueur)
|
|
|
|
|
{
|
|
|
|
|
if (index < tailleMax)
|
|
|
|
|
if (estComplet() == false)
|
|
|
|
|
{
|
|
|
|
|
lesCombinaisonsJoueur[index] = combinaisonJoueur;
|
|
|
|
|
index++;
|
|
|
|
@ -25,5 +32,10 @@ namespace BibliothequeClasses
|
|
|
|
|
throw new Exception("Le plateau est plein, impossible d'ajouter une combinaison supplémentaire.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool estComplet()
|
|
|
|
|
{
|
|
|
|
|
return index >= tailleMax;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|