//Standard shuffle algorithm static void shuffleCards(ModifierCard[] deck) { System.Random r = new System.Random(); for (int i = 0; i < deck.Length; i++) { int j = r.Next(i, deck.Length); ModifierCard tmp = deck[i]; deck[i] = deck[j]; deck[j] = tmp; } }
static void setCommunityChest() { communityChestCards[0] = new ModifierCard("communityChest", "Advance to GO", "moveTo00"); communityChestCards[1] = new ModifierCard("communityChest", "Bank error in your favor. Collect $200", "add+200"); communityChestCards[2] = new ModifierCard("communityChest", "Doctor's Fees. Pay $50", "add-050"); communityChestCards[3] = new ModifierCard("communityChest", "From sale of stock you get $50", "add+050"); communityChestCards[4] = new ModifierCard("communityChest", "Get out of jail free", "gooj"); communityChestCards[5] = new ModifierCard("communityChest", "Go To Jail-Go directly to Jail-Do not pass GO, do not collect $200", "jail"); communityChestCards[6] = new ModifierCard("communityChest", "Grand Opera Night. Collect $50 from every player for opening night seats", "playersPay50"); communityChestCards[7] = new ModifierCard("communityChest", "Holiday Fund Matures. Receive $100", "add+100"); communityChestCards[8] = new ModifierCard("communityChest", "Income tax refund. Collect $20", "jail"); communityChestCards[9] = new ModifierCard("communityChest", "You inherit $100", "add+100"); communityChestCards[10] = new ModifierCard("communityChest", "Life insurances matures - Collect $100", "add+100"); communityChestCards[11] = new ModifierCard("communityChest", "Hospital Fees - Pay $50", "add-050"); communityChestCards[12] = new ModifierCard("communityChest", "School fees. Pay $50", "add-050"); communityChestCards[13] = new ModifierCard("communityChest", "Receive $25 consultancy fee", "add+25"); communityChestCards[14] = new ModifierCard("communityChest", "You are assessed for street repairs: For each house pay $40, For each hotel pay $115", "streetRepair"); communityChestCards[15] = new ModifierCard("communityChest", "You have won second prize in a beauty contest. Collect $10", "add+010"); shuffleCards(communityChestCards); }
static void setChance() { chanceCards[0] = new ModifierCard("chance", "Advance to GO", "moveTo00"); chanceCards[1] = new ModifierCard("chance", "Advance to Illinois Avenue. If you pass GO collect $200", "moveTo24"); chanceCards[2] = new ModifierCard("chance", "Advance to St. Charles Place If you pass GO collect $200", "moveTo16"); chanceCards[3] = new ModifierCard("chance", "Advance token to the nearest Utility. If unowned, you may buy it from the Bank.\n If owned, throw dice and pay owner a total of 10 times the amount thrown.", "moveToUT"); chanceCards[4] = new ModifierCard("chance", "Advance to the nearest Railroad. If unowned, you may buy it from the Bank.\n If owned, pay owner twice the rental to which they are otherwise entitled.", "moveToRR"); chanceCards[5] = new ModifierCard("chance", "Bank pays you a dividend of $50", "add+050"); chanceCards[6] = new ModifierCard("chance", "Get out of Jail free", "gooj"); chanceCards[7] = new ModifierCard("chance", "Go Back 3 Spaces", "index-3"); chanceCards[8] = new ModifierCard("chance", "Go To Jail-Go directly to Jail-Do not pass GO, do not collect $200", "jail"); chanceCards[9] = new ModifierCard("chance", "Make general repairs on all your property: For each house pay $25, For each hotel pay $100", "generalRepair"); chanceCards[10] = new ModifierCard("chance", "Pay poor tax of $15", "add-015"); chanceCards[11] = new ModifierCard("chance", "Take a trip to Reading Railroad. If you pass GO, collect $200", "moveTo05"); chanceCards[12] = new ModifierCard("chance", "Take a walk on the Boardwalk. Advance token to Boardwalk", "moveTo39"); chanceCards[13] = new ModifierCard("chance", "You have been elected Chairman of the Board. Pay each player $50", "payPlayers"); chanceCards[14] = new ModifierCard("chance", "Your building and loan matures. Collect $150", "add+150"); chanceCards[15] = new ModifierCard("chance", "You have won a crossword competition. Collect $100", "add+100"); shuffleCards(chanceCards); }