Beispiel #1
0
        public Form1()
        {
            InitializeComponent();

            Hand myHand = GetHand(pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5);
            //Hand oponentsHand = GetHand(pictureBox6, pictureBox7, pictureBox8, pictureBox9, pictureBox10);

            List <PictureBox> oponentsPictureBoxes = new List <PictureBox>()
            {
                pictureBox6, pictureBox7, pictureBox8, pictureBox9, pictureBox10
            };
            OponentsHand oponentsHand = new OponentsHand(oponentsPictureBoxes);

            this.player = new RealPlayer(myHand);
            this.player.SetScoreLabel(labelMyScore);

            this.oponent = new Oponent(oponentsHand);
            this.oponent.SetScoreLabel(labelOponentsScore);

            this.referee = new Referee();

            this.player.SeatPlayer(this.referee.GetPlayerHisSeat(pictureBoxMyPlayedCard));
            oponent.SeatPlayer(this.referee.GetPlayerHisSeat(pictureBoxOponentsPlayedCard));


            Participants participants = new Participants();

            participants.Referee = referee;

            participants.Add(this.player);
            participants.Add(oponent);



            this.game = new Game(participants);


            // dealer!
            DeckControl       deckControl = new DeckControl(pictureBoxDeck, labelClosedGame);
            AdutControl       adut        = new AdutControl(pictureBoxAdut, pictureBoxAdutColor);
            CardDealerManager dealer      = new CardDealerManager(deckControl, adut);

            this.game.SetTurnLabel(labelTurn);
            this.game.SetDealer(dealer);


            this.game.Start();
        }
Beispiel #2
0
 public CardDealerManager(DeckControl deckControl, AdutControl adut) : base()
 {
     this.deckControl = deckControl;
     this.adutControl = adut;
 }