public Form1() { InitializeComponent(); Yahtzee model = new Yahtzee(); YahtzeeController controller = new YahtzeeController(model); YahtzeeUI ui = controller.getYahtzeeUI(); this.Controls.Add(ui); }
public YahtzeeController(Yahtzee y) { model = y; teerlingControllers = new TeerlingController[Yahtzee.AANTAL_TEERLINGEN]; for (int i = 0; i < Yahtzee.AANTAL_TEERLINGEN; i++) { teerlingControllers[i] = new TeerlingController(model.getTeerling(i)); } }
public YahtzeeUI(Yahtzee model, YahtzeeController controller) { InitializeComponent(); this.model = model; this.controller = controller; for (int i = 0; i < Yahtzee.AANTAL_TEERLINGEN; i++) { teerlingUIs[i] = this.controller.getTeerlingUI(i); teerlingUIs[i].Location = new Point(12 + i * 110, 55); this.Controls.Add(this.teerlingUIs[i]); } updateUI(); }