Ejemplo n.º 1
0
        // Constructors
        public Game(int n_players, Deck deck, int starting_funds = Money.DEFAULT_ORIGINAL_AMOUNT, int buy_in = Money.DEFAULT_BUY_IN, int max_size = Hand.DEFAULT_MAX_SIZE, int big_blind = Money.DEFAULT_BIG_BLIND, int small_blind = Money.DEFAULT_SMALL_BLIND, int ante = Money.DEFAULT_ANTE)
        {
            if (n_players < 4)
             {
            n_players = 4;
             }
             else if (n_players > 6)
             {
            n_players = 6;
             }

             Random rand = new Random();
             this.deck = deck;
             this.deck.shuffle();

             players = new Player[n_players];
             player_queue = new Queue<Player>(n_players);
             string player_1_name = query_player_1_name();
             bool is_male_player = query_player_1_gender();

             // initialize the players
             // initialize the bank
             // empty out the queue
             // assign and shuffle the deck

             /*
             int starting_funds = Money.DEFAULT_ORIGINAL_AMOUNT;
             int buy_in = Money.DEFAULT_BUY_IN;
             int big_blind = Money.DEFAULT_BIG_BLIND;
             int small_blind = Money.DEFAULT_SMALL_BLIND;
             int ante = Money.DEFAULT_ANTE;
             int max_size = Hand.DEFAULT_MAX_SIZE;
             */

             bool[] AI_genders;
             string[] AI_names = choose_AI_names(player_1_name, out AI_genders);

             players[0] = new Player(starting_funds, buy_in, big_blind, small_blind, ante, deck.draw(5), this.deck, max_size, player_1_name, is_male_player);
             player_queue.Enqueue(players[0]);

             for (int i = 1; i < n_players; i++)
             {
            Wealth_Types wealth_type = (Wealth_Types)rand.Next((int)Wealth_Types.END);
            Betting_Types betting_type = (Betting_Types)rand.Next((int)Betting_Types.END);
            Perception_Types perception_type = (Perception_Types)rand.Next((int)Perception_Types.END);
            Personality personality = new Personality(wealth_type, betting_type, perception_type);

            players[i] = new AIPlayer(personality, this.deck, AI_names[i - 1], AI_genders[i - 1]);

            player_queue.Enqueue(players[i]);
             }

             // assign the bank's variables
             bank = new Money(0, buy_in, big_blind, small_blind, ante);
        }
Ejemplo n.º 2
0
 public Player(Deck deck)
     : this(Money.DEFAULT_ORIGINAL_AMOUNT, Money.DEFAULT_BUY_IN, Money.DEFAULT_BIG_BLIND, Money.DEFAULT_SMALL_BLIND, Money.DEFAULT_ANTE, deck.draw(5), deck, 5, "Player_1", true)
 {
 }
Ejemplo n.º 3
0
 public Player(Deck deck, string name, bool is_male)
     : this(Money.DEFAULT_ORIGINAL_AMOUNT, Money.DEFAULT_BUY_IN, Money.DEFAULT_BIG_BLIND, Money.DEFAULT_SMALL_BLIND, Money.DEFAULT_ANTE, deck.draw(5), deck, 5, name, is_male)
 {
 }
Ejemplo n.º 4
0
 public AIPlayer(Personality personality, Deck deck, string name, bool is_male)
     : this(personality, (int)(Personality.convert_wealth_type_to_value(personality.wealth_type)), Money.DEFAULT_BUY_IN, Money.DEFAULT_BIG_BLIND, Money.DEFAULT_SMALL_BLIND, Money.DEFAULT_ANTE, deck.draw(Hand.DEFAULT_MAX_SIZE), deck, Hand.DEFAULT_MAX_SIZE, name, is_male)
 {
     AI_Ctor_Helper(personality);
 }
Ejemplo n.º 5
0
 public Player(Deck deck, string name, bool is_male) : this(Money.DEFAULT_ORIGINAL_AMOUNT, Money.DEFAULT_BUY_IN, Money.DEFAULT_BIG_BLIND, Money.DEFAULT_SMALL_BLIND, Money.DEFAULT_ANTE, deck.draw(5), deck, 5, name, is_male)
 {
 }
Ejemplo n.º 6
0
 public AIPlayer(Personality personality, Deck deck, string name, bool is_male) : this(personality, (int)(Personality.convert_wealth_type_to_value(personality.wealth_type)), Money.DEFAULT_BUY_IN, Money.DEFAULT_BIG_BLIND, Money.DEFAULT_SMALL_BLIND, Money.DEFAULT_ANTE, deck.draw(Hand.DEFAULT_MAX_SIZE), deck, Hand.DEFAULT_MAX_SIZE, name, is_male)
 {
     AI_Ctor_Helper(personality);
 }