Exemplo n.º 1
0
        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);
            }
        }