Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            // play cards vs db...

            BingoSession session = new BingoSession();
            Pattern      p       = new Pattern();

            p.algorithm     = OpenSkieScheduler3.PatternDescriptionTable.match_types.CrazyMark;
            p.repeat_count  = 24;
            p.crazy_hardway = true;

            BingoGame game;

            session.GameList.Add(game = new BingoGame(new BingoGameCore4.Pattern[] { p }));

            BingoGameGroup game_group = new BingoGameGroup(Guid.Empty);

            game_group.Add(game);

            BingoPacks packs = new BingoPacks(session.GameList, schedule, null);


            BingoGameCore4.CardMaster.CardReader card_file
                = new BingoGameCore4.CardMaster.CardReader("c:\\ftn3000\\data\\cards\\Random 360k (50s300w)(81_Full).20110225.dat");

            BingoDealer dealer = BingoDealers.GetDealer(card_file, 1, 1);

            packs.CreatePack(dealer, "Test Pack");
            BingoPack pack = packs.MakePack("Test Pack", card_file.Length);

            BingoSessionEvent session_evnet = new BingoSessionEvent(session, true);
            BingoPlayer       player;

            player = new BingoPlayer();

            PlayerTransaction transaction;

            player.transactions.Add(transaction = new PlayerTransaction(player, 12345689));
            player.PlayPack(transaction, pack);

            session_evnet.PlayerList.Add(player);
            BallDataExternal bde = new BallDataExternal();

            session_evnet.ball_data = bde;

            BingoGameState game_state = session_evnet.StepTo(0);

            bde.Balls = calls[0];
            session_evnet.Play(game_state);
        }
Beispiel #2
0
        /// <summary>
        ///  Creates a 25 number bingo card.  The center is marked with a 0.
        /// </summary>
        /// <returns>An array of [col,row]</returns>

        public byte[, ,] Create(BingoDealer dealer
                                , int starting_card, int card_offset, int faces, bool starburst)
        //public byte[, ,] Create( int faces, bool starburst )
        {
            if (faces == 1)
            {
                if (card == 0)
                {
                    nums = bdi.CallBalls();
                }
                byte[] face_data = new byte[72];
                Get24of75Ex(3, face_data);
                byte[, ,] result = new byte[1, 5, 5];
                int r, c;
                int n = card * 24;
                for (c = 0; c < 5; c++)
                {
                    for (r = 0; r < 5; r++)
                    {
                        if (r == 2 && c == 2)
                        {
                            result[0, c, r] = 0;
                        }
                        else
                        {
                            result[0, c, r] = face_data[n++];
                        }
                    }
                }

                // min inclusive max exclusive
                int spot = entropy.Next(24);
                if (spot >= 12)
                {
                    spot++;
                }
                // bonus spot
                result[0, 2, 2] = result[0, spot / 5, spot % 5];

                card++;
                if (card == 3)
                {
                    card = 0;
                }
                return(result);
            }
            else if (faces == 2)
            {
                nums = bdi.CallBalls();
                byte[] face_data = new byte[72];

                Get24of75Ex(3, face_data);
                byte[, ,] result = new byte[2, 5, 5];
                int i, j;
                int n = card * 24;
                for (int c = 0; c < 2; c++)
                {
                    for (i = 0; i < 5; i++)
                    {
                        for (j = 0; j < 5; j++)
                        {
                            if (i == 2 && j == 2)
                            {
                                result[c, i, j] = 0;
                            }
                            else
                            {
                                result[c, i, j] = face_data[n++];
                            }
                        }
                    }
                    // hotball
                    result[0, 2, 2] = (byte)entropy.Next(1, 76);
                }
                card = 0;
                return(result);
            }
            return(null);
        }