Skip to content
Snippets Groups Projects
Commit 13b04661 authored by HUONG THOMAS's avatar HUONG THOMAS
Browse files

Merge branch 'master' into 'master'

Fix du patron observeateur

See merge request deleted_user_177013/t4-foc21!23
parents 2f4e0c2d 06062eb1
Branches
No related merge requests found
......@@ -23,6 +23,9 @@ namespace fichier1
this.game = partie;
this.ctrl = new GameController(this.game);
this.game.Subscribe(this);
this.game.init(5, 2);
}
public void OnCompleted()
......@@ -38,6 +41,7 @@ namespace fichier1
public void OnNext(Partie value)
{
Console.WriteLine("Next mot");
pnlContent.Controls.Clear();
pnlContent.Controls.Add(new ViewDecoupage(ctrl));
}
......
......@@ -18,12 +18,20 @@ namespace fichier1.Model
public Partie(BddContext context)
{
this.context = context;
this.observers = new List<IObserver<Partie>>();
}
public void init(int nbMots, float complexite)
{
this.nbMots = nbMots;
this.observers = new List<IObserver<Partie>>();
this.motCourant = 0;
this.genererMots(nbMots, complexite);
this.formaterPropositions();
foreach (IObserver<Partie> obs in observers)
{
obs.OnNext(this);
}
}
public void genererMots(int nb, float complexite)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment