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.
mastermind/Sources/ConsoleApp1/Program.cs

40 lines
1.1 KiB

using CoreLibrary.Core;
using CoreLibrary.Joueurs;
using System.Reflection;
Code codeSecret = new Code(1);
codeSecret.AjouterJeton(new Jeton(Couleur.Rouge));
Code code1 = new Code(1);
code1.AjouterJeton(new Jeton(Couleur.Vert));
Code code2 = new Code(1);
code2.AjouterJeton(new Jeton(Couleur.Jaune));
List<Code> codes = new List<Code>([
codeSecret,
code1,
code2,
]);
Plateau plateau = new Plateau(1, 1);
FieldInfo? codeSecretInfo = typeof(Plateau).GetField("codeSecret", BindingFlags.NonPublic | BindingFlags.Instance);
codeSecretInfo.SetValue(plateau, codeSecret);
codeSecretInfo = typeof(Plateau).GetField("codeSecret", BindingFlags.NonPublic | BindingFlags.Instance);
plateau.AjouterCode(codeSecret);
var a = codeSecretInfo.GetValue(plateau);
var b = plateau.Grille;
MethodInfo? SupprimerCodesImpossiblesInfo = typeof(Robot).GetMethod("SupprimerCodesImpossibles", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
SupprimerCodesImpossiblesInfo.Invoke(new Robot(), [codes, plateau]);
Console.ReadLine();