public playerController(pokerController controllerPoker, int numberOfCards) { _controllerPoker = controllerPoker; _model = new playerModel(numberOfCards); makeCardViews(_model.NumberOfCards); _view = new playerView(this); }
public playerController(pokerController controllerPoker, int numberOfCards) { _controllerPoker = controllerPoker; _model = new playerModel(numberOfCards, this); makeCardViews(_model.NumberOfCards); _view = new playerView(this); }
private void pokerView_Load(object sender, EventArgs e) { //toevoegen views van spelers List <playerView> players = _controller.getViewsPlayers(); List <int> xPos = new List <int>(new int[] { 20, 780, 160, 640, 300, 500 }); List <int> yPos = new List <int>(new int[] { 20, 20, 210, 210, 400, 400, }); int curPlayerIndex = 0; foreach (playerView player in players) { playerView currentPlayer = player; currentPlayer.Location = new Point(xPos[curPlayerIndex], yPos[curPlayerIndex]); Controls.Add(currentPlayer); curPlayerIndex++; } //toevoegen view van flop, turn, river, total pot playerController flop = new playerController(_controller, 5); _controller.getModelPoker().FlopController = flop; playerView flopView = flop.getViewPlayer(); flopView.Location = new Point(280, 20); Controls.Add(flopView); //toevoegen knoppen speler buttonsController button = new buttonsController(); buttonsView buttonView = button.getViewButtons(); buttonView.Location = new Point(320, 600); Controls.Add(buttonView); }
public void createViewsPlayers(int numberOfPlayers) { for (int playerNr = 0; playerNr < numberOfPlayers; playerNr++) { playerController player = new playerController(this, 2); //Enkele player aanmaken met injectie van hoofdcontroller playerView playerView = player.getViewPlayer(); //Nieuwe view player _model.addPlayer(player); //toevoegen speler aan lijst } }
public List <playerView> getViewsPlayers() { List <playerView> playersView = new List <playerView>(); // Maak een lijst die de views zal opvangen foreach (playerController player in getModelPoker().Players) // Loop over het huidig aantal kaarten uit het model { playerView playerView = player.getViewPlayer(); // Haal de view op voor iedere kaart playersView.Add(playerView); // Voeg de kaart toe aan de lijst die de views opvangt } return(playersView); // Return de lijst met views van de kaarten }
public void initializeViewPoker() { //toevoegen knoppen speler buttonsController button = new buttonsController(_controller); buttonsView buttonView = button.getViewButtons(); _controller.getModelPoker().View_button = buttonView; buttonView.Location = new Point(320, 600); button.getViewButtons().updateCurrentPlayer(); buttonView.toggleDisable(); Controls.Add(buttonView); //toevoegen views van spelers List <playerView> players = _controller.getViewsPlayers(); List <playerController> players_rightOrder = new List <playerController>(); List <int> xPos = new List <int>(new int[] { 20, 780, 160, 640, 300, 500 }); List <int> yPos = new List <int>(new int[] { 20, 20, 210, 210, 400, 400, }); int curPlayerIndex = 0; int curIndexAtPlace = 0; foreach (playerView player in players) { playerView currentPlayer = player; currentPlayer.Location = new Point(xPos[curPlayerIndex], yPos[curPlayerIndex]); Controls.Add(currentPlayer); curPlayerIndex++; if (curPlayerIndex % 2 == 0) { curIndexAtPlace++; } players_rightOrder.Insert(curIndexAtPlace, player.getControllerPlayer()); } int curPlayerIndex2 = 0; foreach (playerController player in players_rightOrder) { curPlayerIndex2++; player.getModelPlayer().Name = "Speler: " + curPlayerIndex2; player.getViewPlayer().updateName(); } players_rightOrder[0].getModelPlayer().Special = "small"; players_rightOrder[1].getModelPlayer().Special = "big"; _controller.getModelPoker().Players = players_rightOrder; _controller.getModelPoker().IndexStopPlayer = 0; //toevoegen view van flop, turn, river, total pot playerController flop = new playerController(_controller, 5); /*flop.getModelPlayer().Cards[0].getModelCard().CardKind = "hearts"; * flop.getModelPlayer().Cards[1].getModelCard().CardKind = "hearts"; * flop.getModelPlayer().Cards[2].getModelCard().CardKind = "hearts"; * flop.getModelPlayer().Cards[3].getModelCard().CardKind = "hearts"; * flop.getModelPlayer().Cards[4].getModelCard().CardKind = "hearts"; * * flop.getModelPlayer().Cards[0].getModelCard().CardValue = 8; * flop.getModelPlayer().Cards[1].getModelCard().CardValue = 8; * flop.getModelPlayer().Cards[2].getModelCard().CardValue = 6; * flop.getModelPlayer().Cards[3].getModelCard().CardValue = 6; * flop.getModelPlayer().Cards[4].getModelCard().CardValue = 6;*/ _controller.getModelPoker().FlopController = flop; playerView flopView = flop.getViewPlayer(); flopView.Location = new Point(280, 20); Controls.Add(flopView); flopView.updateKapitaal(); _controller.makeCurrent(1); _controller.getModelPoker().FirstGame = true; _controller.getModelPoker().FirstRoundOfHand = false; }