static Queue <SpecialCards> CreateCommunityChestQueue() { List <int> li = RandomList(0, 16); Queue <SpecialCards> CommunityChestCards = new Queue <SpecialCards>(); for (int i = 0; i < 16; i++) { int val = li[i]; SpecialCards c = new SpecialCards(val, false); CommunityChestCards.Enqueue(c); } return(CommunityChestCards); }
static Queue <SpecialCards> CreateChanceQueue() { List <int> li = RandomList(0, 16); Queue <SpecialCards> ChanceCards = new Queue <SpecialCards>(); for (int i = 0; i < 16; i++) { int val = li[i]; SpecialCards c = new SpecialCards(val, true); ChanceCards.Enqueue(c); } return(ChanceCards); }
public void playSpecialSpace(ListSpaces B, ListPlayer P, Queue <SpecialCards> Chance, Queue <SpecialCards> CommunityChest) { SpecialSpace sp = (SpecialSpace)B.getSpace(position); if (sp.go_to_prison) { Console.WriteLine("Go to prison !"); Console.WriteLine("You will not receive your 200 if you pas by the Start"); goToPrison(); } if (sp.tax) { Console.WriteLine("Pay a tax of 100 euros"); SpecialSpace park = (SpecialSpace)B.getSpace(20); park.money_in_parking += 100; account -= 100; Console.WriteLine("The money will go to the Public Parking (position 20)"); Console.WriteLine("The actual amount of money in the parking is : " + park.money_in_parking); } if (sp.luxe_tax) { Console.WriteLine("Pay a tax of 200 euros"); SpecialSpace park = (SpecialSpace)B.getSpace(20); park.money_in_parking += 200; account -= 200; Console.WriteLine("The money will go to the Public Parking (position 20)"); Console.WriteLine("The actual amount of money in the parking is : " + park.money_in_parking); } if (sp.chance) { Console.WriteLine("Press enter to pull a chance card"); Console.ReadLine(); SpecialCards cha = Chance.Dequeue(); Console.WriteLine(cha.SpecialCardAction(this, P, B)); Chance.Enqueue(cha); } if (sp.community_chest) { Console.WriteLine("Press enter to pull a community chest card"); Console.ReadLine(); SpecialCards cc = CommunityChest.Dequeue(); Console.WriteLine(cc.SpecialCardAction(this, P, B)); Chance.Enqueue(cc); } }