private CardPositions[] InitializeSamplePositions()
        {
            positions[0] = new CardPositions(1, 5, 0);
            positions[1] = new CardPositions(2, 10, 1);

            return(positions);
        }
Пример #2
0
    public override void _Ready()
    {
        viewUtils = new ViewportUtils(GetViewport());
        viewUtils.OnViewportResize += new ViewportUtils.OnViewportResizeDelegate(OnViewportResize);

        table         = new Table(viewUtils, Piles);
        deck          = new Deck(viewUtils, Cards);
        cardPositions = new CardPositions(viewUtils);

        VisualServer.SetDefaultClearColor(BackgroundColor);
    }
        private async Task <CardPositions[]> InitializeSamplePositions(bool randomized)
        {
            return(await Task.Run(async() =>
            {
                randomizedPositions[0] = new CardPositions(1, 5, 0);
                randomizedPositions[1] = new CardPositions(2, 10, 1);

                var randomize = new RandomizePositions(2, randomizedPositions);

                var result = randomize.ReturnNewPositions().Result;

                return result;
            }));
        }
Пример #4
0
        public DisplayHand(int NO_OF_PLAYERS, int NO_OF_COMPS, string[] players)
        {
            InitializeComponent();
            this.BJgame = new Game(NO_OF_PLAYERS, NO_OF_COMPS, players);

            CardPositions.Add(new CardPosition()
            {
                Location = new Point {
                    X = 200, Y = 235
                }, Rotation = 0, Translation = 0
            });
            CardPositions.Add(new CardPosition()
            {
                Location = new Point {
                    X = 620, Y = 310
                }, Rotation = 0, Translation = 0
            });
            CardPositions.Add(new CardPosition()
            {
                Location = new Point {
                    X = 450, Y = 345
                }, Rotation = 0, Translation = 0
            });
            CardPositions.Add(new CardPosition()
            {
                Location = new Point {
                    X = 260, Y = 310
                }, Rotation = 0, Translation = 0
            });
            CardPositions.Add(new CardPosition()
            {
                Location = new Point {
                    X = 600, Y = 235
                }, Rotation = 0, Translation = 0
            });

            switch (NO_OF_PLAYERS)
            {
            case 1:
                this.panelChair3.Visible = true;
                //PlayerChairs.Add(new Chair() { Hit = this.btnHit3, Stay = this.btnStay3, Bet = this.txtBet3, Chips = this.lblChips3, Count = this.lblCount3, BetInc = this.btnBetInc3, BetDec = this.btnBetDec3, Player = this.BJgame.gameTable.players[0], CardPosition = CardPositions[2]});
                lblPlayer3.Text = BJgame.gameTable.players[0].name;
                Chair3          = new Chair()
                {
                    Hit = this.btnHit3, Stay = this.btnStay3, Bet = this.txtBet3, Chips = this.lblChips3, Count = this.lblCount3, BetInc = this.btnBetInc3, BetDec = this.btnBetDec3, Player = this.BJgame.gameTable.players[0], CardPosition = CardPositions[2]
                };
                PlayerChairs.Add(Chair3);
                break;

            case 2:
                this.panelChair3.Visible = true;
                this.panelChair4.Visible = true;
                Chair3 = new Chair()
                {
                    Hit = this.btnHit3, Stay = this.btnStay3, Bet = this.txtBet3, Chips = this.lblChips3, Count = this.lblCount3, BetInc = this.btnBetInc3, BetDec = this.btnBetDec3, Player = this.BJgame.gameTable.players[0], CardPosition = CardPositions[2]
                };
                lblPlayer3.Text = BJgame.gameTable.players[0].name;
                PlayerChairs.Add(Chair3);
                Chair4 = new Chair()
                {
                    Hit = this.btnHit4, Stay = this.btnStay4, Bet = this.txtBet4, Chips = this.lblChips4, Count = this.lblCount4, BetInc = this.btnBetInc4, BetDec = this.btnBetDec4, Player = this.BJgame.gameTable.players[1], CardPosition = CardPositions[3]
                };
                lblPlayer4.Text = BJgame.gameTable.players[1].name;
                PlayerChairs.Add(Chair4);
                break;

            case 3:
                this.panelChair2.Visible = true;
                this.panelChair3.Visible = true;
                this.panelChair4.Visible = true;
                Chair2 = new Chair()
                {
                    Hit = this.btnHit2, Stay = this.btnStay2, Bet = this.txtBet2, Chips = this.lblChips2, Count = this.lblCount2, BetInc = this.btnBetInc2, BetDec = this.btnBetDec2, Player = this.BJgame.gameTable.players[0], CardPosition = CardPositions[1]
                };
                lblPlayer2.Text = BJgame.gameTable.players[0].name;
                PlayerChairs.Add(Chair2);
                Chair3 = new Chair()
                {
                    Hit = this.btnHit3, Stay = this.btnStay3, Bet = this.txtBet3, Chips = this.lblChips3, Count = this.lblCount3, BetInc = this.btnBetInc3, BetDec = this.btnBetDec3, Player = this.BJgame.gameTable.players[0], CardPosition = CardPositions[2]
                };
                lblPlayer3.Text = BJgame.gameTable.players[1].name;
                PlayerChairs.Add(Chair3);
                Chair4 = new Chair()
                {
                    Hit = this.btnHit4, Stay = this.btnStay4, Bet = this.txtBet4, Chips = this.lblChips4, Count = this.lblCount4, BetInc = this.btnBetInc4, BetDec = this.btnBetDec4, Player = this.BJgame.gameTable.players[1], CardPosition = CardPositions[3]
                };
                lblPlayer4.Text = BJgame.gameTable.players[2].name;
                PlayerChairs.Add(Chair4);
                break;
            }
        }