// Constructor takes reference to deck, master, difficulty, which position to be in, and the name public AIPlayer(ref Deck d, frmBetter21 m, int dif, int num, string inputName) : base(ref d, ref m) { // Setting the UI variables based on the position if (num == 2) { UIx = 1100; UIy = 300; handPosition = 1350; } if (num == 1) { UIx = 200; UIy = 300; handPosition = 50; } // Set the difficulty difficulty = difficultyLevels[dif]; // Setting the name name = inputName; // Create a new random generator rndGen = new Random(); // Create the UI CreateUI(); }
/* CONSTRUCTOR */ // Takes reference to deck and form. public Player(ref Deck d, ref frmBetter21 m) { // Sets the deck and master to the supplied values deck = d; master = m; // Sets the initial money money = 500; }
/* CONSTRUCTOR */ public Dealer(ref Deck d, frmBetter21 m) : base(ref d, ref m) { name = "Dealer"; handPosition = 50; UIx = 700; UIy = 186; CreateUI(); }
// Constructor takes a reference to the deck, the master form, and it's name // Calls the Player constructor public User(ref Deck d, frmBetter21 m, string inputName) : base(ref d, ref m) { // Sets the name name = inputName; // Set the UI positions UIx = 700; UIy = 400; handPosition = 550; // Create the UI elements CreateUI(); }