示例#1
0
        static void TestHandCards()
        {
            string bitmapsPath = String.Format("{0}", ConfigurationSettings.AppSettings["BitmapsFolderLocation"]);

            CardDetectionHandler.Initialize(bitmapsPath);

            Card[] hand = CardDetectionHandler.RetrieveYourHand();
            Card[] comm = CardDetectionHandler.RetrieveCommunityCards();

            Console.WriteLine("Cards in your hand : ");
            foreach (Card card in hand)
            {
                if (card != null)
                {
                    Console.WriteLine(card.CardRank + " of " + card.CardSuit);
                }
            }

            Console.WriteLine("\nCards in Community : ");
            if (comm != null)
            {
                foreach (Card card in comm)
                {
                    if (card != null)
                    {
                        Console.WriteLine(card.CardRank + " of " + card.CardSuit);
                    }
                }
            }

            Console.ReadLine();
        }
示例#2
0
        private void btnCommCards_Click(object sender, EventArgs e)
        {
            Card[] comm = CardDetectionHandler.RetrieveCommunityCards();

            string msg = "";

            if (comm != null)
            {
                foreach (Card card in comm)
                {
                    if (card != null)
                    {
                        msg += card.CardRank + " of " + card.CardSuit + "\n";
                    }
                }
            }

            if (msg == "")
            {
                MessageBox.Show("No cards in Community.", "Cards in Community");
            }
            else
            {
                MessageBox.Show(msg, "Cards in Community");
            }
        }
示例#3
0
        private void btnCommunityCardCapture_Click(object sender, EventArgs e)
        {
            Bitmap PokerStarsWindow = CardDetectionHandler.CaptureCommunityCardsImage();

            pictureBoxScreen.Width           = PokerStarsWindow.Width;
            pictureBoxScreen.Height          = PokerStarsWindow.Height;
            pictureBoxScreen.BackgroundImage = PokerStarsWindow;
        }
示例#4
0
        public Form1()
        {
            InitializeComponent();

            string bitmapsPath = String.Format("{0}", ConfigurationSettings.AppSettings["BitmapsFolderLocation"]);

            CardDetectionHandler.Initialize(bitmapsPath);
        }
示例#5
0
        private void btnHandCards_Click(object sender, EventArgs e)
        {
            Card[] hand = CardDetectionHandler.RetrieveYourHand();

            string msg = "";

            foreach (Card card in hand)
            {
                if (card != null)
                {
                    msg += card.CardRank + " of " + card.CardSuit + "\n";
                }
            }

            if (msg == "")
            {
                MessageBox.Show("No cards in hand.", "Cards in Hand");
            }
            else
            {
                MessageBox.Show(msg, "Cards in Hand");
            }
        }