private void playerView_Load(object sender, EventArgs e) { //toevoegen kaarten List <cardView> cards = _controller.getCardsView(); //Lijst met alle views int cardWidth = cards[0].Width; int cardHeight = cards[0].Height; foreach (cardView card in cards) { cardView currentCard = card; int xPos = cards.IndexOf(card) * cardWidth; //x positie zetten afhankelijk van index en width currentCard.Location = new Point(xPos, 0); Controls.Add(currentCard); //huidige kaart toevoegen aan view currentCard.updateView(); } int height = this.PreferredSize.Height - kapitaal.PreferredHeight - 7; int width; if (_controller == _controller.getControllerPoker().getModelPoker().FlopController) { width = 50; kapitaal.Text = "Totaalpot: € 99"; } else { width = 40; kapitaal.Text = "Uw kapitaal: € 99"; } kapitaal.Location = new Point(width, height); }
private void playerView_Load(object sender, EventArgs e) { //toevoegen kaarten List <cardView> cards = _controller.getCardsView(); //Lijst met alle views int cardWidth = cards[0].Width; int cardHeight = cards[0].Height; foreach (cardView card in cards) { cardView currentCard = card; int xPos = cards.IndexOf(card) * cardWidth; //x positie zetten afhankelijk van index en width currentCard.Location = new Point(xPos, 0); Controls.Add(currentCard); //huidige kaart toevoegen aan view currentCard.updateView(); } int height = cardHeight; if (_controller == _controller.getControllerPoker().getModelPoker().FlopController) { naam.Hide(); curInzet.Hide(); height += 5; kapitaal.Font = new Font(kapitaal.Font.Name, (kapitaal.Font.Size + 5), kapitaal.Font.Style, kapitaal.Font.Unit); } else { updateName(); naam.Location = new Point(5, height); height += naam.Height + 5; updateCurInzet(); curInzet.Location = new Point(5, height + kapitaal.Height + 5); } updateKapitaal(); kapitaal.Location = new Point(5, height); }
public void flipCard() { _model.ShowCard = !_model.ShowCard; // omdraaien van kaard _view.updateView(); // updaten van view }