Ejemplo n.º 1
0
        public void setUpProperties()
        {
            //Create instances of property factories
            LuckFactory        luckFactory    = new LuckFactory();
            ResidentialFactory resFactory     = new ResidentialFactory();
            TransportFactory   transFactory   = new TransportFactory();
            UtilityFactory     utilFactory    = new UtilityFactory();
            PropertyFactory    genericFactory = new PropertyFactory();

            //Create properties and add them to the board
            //Loading property details from file has not been implemented
            //Property names are taken from the "Here and Now" New Zealand version of monopoly
            //Rents are tenth of cost of property
            //Colours have not been implemented
            Board.access().addProperty(luckFactory.create("Go", false, 200));
            Board.access().addProperty(resFactory.create("Ohakune Carrot", 60, 6, 50));
            Board.access().addProperty(luckFactory.create("Community Chest", false, 50)); // not properly implemented just 50 benefit
            Board.access().addProperty(resFactory.create("Te Puke, Giant Kiwifruit", 60, 6, 50));
            Board.access().addProperty(luckFactory.create("Income Tax", true, 200));
            Board.access().addProperty(transFactory.create("Auckland International Airport"));
            Board.access().addProperty(resFactory.create("Te Papa", 100, 10, 50));
            Board.access().addProperty(luckFactory.create("Chance", true, 50)); // not properly implemented just 50 penalty
            Board.access().addProperty(resFactory.create("Waitangi Treaty Grounds", 100, 10, 50));
            Board.access().addProperty(resFactory.create("Larnach Castle", 120, 12, 50));
            Board.access().addProperty(genericFactory.create("Jail")); //not properly implemented just a property that does nothing
            Board.access().addProperty(resFactory.create("Cape Reinga Lighthouse", 140, 14, 100));
            Board.access().addProperty(utilFactory.create("Mobile Phone Company"));
            Board.access().addProperty(resFactory.create("Lake Taupo", 140, 14, 100));
            Board.access().addProperty(resFactory.create("Queenstown Ski Fields", 160, 16, 100));
            Board.access().addProperty(transFactory.create("Dunedin Railway Station"));
            Board.access().addProperty(resFactory.create("Fox Glacier", 180, 18, 100));
            Board.access().addProperty(luckFactory.create("Community Chest", false, 50)); // not properly implemented just 50 benefit
            Board.access().addProperty(resFactory.create("Milford Sound", 180, 18, 100));
            Board.access().addProperty(resFactory.create("Mt Cook", 200, 20, 100));
            Board.access().addProperty(genericFactory.create("Free Parking"));  //not properly implemented just a property that does nothing
            Board.access().addProperty(resFactory.create("Ninety Mile Beach", 220, 22, 150));
            Board.access().addProperty(luckFactory.create("Chance", true, 50)); // not properly implemented just 50 penalty
            Board.access().addProperty(resFactory.create("Golden Bay", 220, 22, 150));
            Board.access().addProperty(resFactory.create("Moeraki Boulders, Oamaru", 240, 24, 150));
            Board.access().addProperty(transFactory.create("Port Tauranga"));
            Board.access().addProperty(resFactory.create("Waitomo Caves", 260, 26, 150));
            Board.access().addProperty(resFactory.create("Mt Maunganui", 260, 26, 150));
            Board.access().addProperty(utilFactory.create("Internet Service Provider"));
            Board.access().addProperty(resFactory.create("Art Deco Buildings, Napier", 280, 28, 150));
            Board.access().addProperty(genericFactory.create("Go to Jail")); //not properly implemented just a property that does nothing
            Board.access().addProperty(resFactory.create("Cable Cars Wellington", 300, 30, 200));
            Board.access().addProperty(resFactory.create("Cathedral Square", 300, 30, 200));
            Board.access().addProperty(luckFactory.create("Community Chest", false, 50)); // not properly implemented just 50 benefit
            Board.access().addProperty(resFactory.create("The Square, Palmerston North", 320, 32, 200));
            Board.access().addProperty(transFactory.create("Picton Ferry"));
            Board.access().addProperty(luckFactory.create("Chance", true, 50)); // not properly implemented just 50 penalty
            Board.access().addProperty(resFactory.create("Pukekura Park, Festival of Lights", 350, 35, 200));
            Board.access().addProperty(luckFactory.create("Super Tax", true, 100));
            Board.access().addProperty(resFactory.create("Rangitoto", 400, 40, 200));


            Console.WriteLine("Properties have been setup");
        }
Ejemplo n.º 2
0
 public void testTransport()
 {
     //create instance of factory
     TransportFactory f = new TransportFactory();
     //create instance from factory
     Transport p = f.create("Transport");
     //check that it is right type
     Type t = new Transport().GetType();
     Assert.IsInstanceOfType(t, p);
 }
Ejemplo n.º 3
0
        public void testTransport()
        {
            //create instance of factory
            TransportFactory f = new TransportFactory();
            //create instance from factory
            Transport p = f.create("Transport");
            //check that it is right type
            Type t = new Transport().GetType();

            Assert.IsInstanceOfType(t, p);
        }
Ejemplo n.º 4
0
        public void setUpProperties()
        {
            //Create instances of property factories
            LuckFactory luckFactory = new LuckFactory();
            ResidentialFactory resFactory = new ResidentialFactory();
            TransportFactory transFactory = new TransportFactory();
            UtilityFactory utilFactory = new UtilityFactory();
            PropertyFactory genericFactory = new PropertyFactory();

            //Create properties and add them to the board
            //Loading property details from file has not been implemented
            //Property names are taken from the "Here and Now" New Zealand version of monopoly
            //Rents are tenth of cost of property
            //Colours have not been implemented
            Board.access().addProperty(luckFactory.create("Go", false, 200));
            Board.access().addProperty(resFactory.create("Ohakune Carrot", 60, 6, 50));
            Board.access().addProperty(luckFactory.create("Community Chest", false, 50)); // not properly implemented just 50 benefit
            Board.access().addProperty(resFactory.create("Te Puke, Giant Kiwifruit", 60, 6, 50));
            Board.access().addProperty(luckFactory.create("Income Tax", true, 200));
            Board.access().addProperty(transFactory.create("Auckland International Airport"));
            Board.access().addProperty(resFactory.create("Te Papa", 100, 10, 50));
            Board.access().addProperty(luckFactory.create("Chance", true, 50)); // not properly implemented just 50 penalty
            Board.access().addProperty(resFactory.create("Waitangi Treaty Grounds", 100, 10, 50));
            Board.access().addProperty(resFactory.create("Larnach Castle", 120, 12, 50));
            Board.access().addProperty(genericFactory.create("Jail")); //not properly implemented just a property that does nothing
            Board.access().addProperty(resFactory.create("Cape Reinga Lighthouse", 140, 14, 100));
            Board.access().addProperty(utilFactory.create("Mobile Phone Company"));
            Board.access().addProperty(resFactory.create("Lake Taupo", 140, 14, 100));
            Board.access().addProperty(resFactory.create("Queenstown Ski Fields", 160, 16, 100));
            Board.access().addProperty(transFactory.create("Dunedin Railway Station"));
            Board.access().addProperty(resFactory.create("Fox Glacier", 180, 18, 100));
            Board.access().addProperty(luckFactory.create("Community Chest", false, 50)); // not properly implemented just 50 benefit
            Board.access().addProperty(resFactory.create("Milford Sound", 180, 18, 100));
            Board.access().addProperty(resFactory.create("Mt Cook", 200, 20, 100));
            Board.access().addProperty(genericFactory.create("Free Parking")); //not properly implemented just a property that does nothing
            Board.access().addProperty(resFactory.create("Ninety Mile Beach", 220, 22, 150));
            Board.access().addProperty(luckFactory.create("Chance", true, 50)); // not properly implemented just 50 penalty
            Board.access().addProperty(resFactory.create("Golden Bay", 220, 22, 150));
            Board.access().addProperty(resFactory.create("Moeraki Boulders, Oamaru", 240, 24, 150));
            Board.access().addProperty(transFactory.create("Port Tauranga"));
            Board.access().addProperty(resFactory.create("Waitomo Caves", 260, 26, 150));
            Board.access().addProperty(resFactory.create("Mt Maunganui", 260, 26, 150));
            Board.access().addProperty(utilFactory.create("Internet Service Provider"));
            Board.access().addProperty(resFactory.create("Art Deco Buildings, Napier", 280, 28, 150));
            Board.access().addProperty(genericFactory.create("Go to Jail")); //not properly implemented just a property that does nothing
            Board.access().addProperty(resFactory.create("Cable Cars Wellington", 300, 30, 200));
            Board.access().addProperty(resFactory.create("Cathedral Square", 300, 30, 200));
            Board.access().addProperty(luckFactory.create("Community Chest", false, 50)); // not properly implemented just 50 benefit
            Board.access().addProperty(resFactory.create("The Square, Palmerston North", 320, 32, 200));
            Board.access().addProperty(transFactory.create("Picton Ferry"));
            Board.access().addProperty(luckFactory.create("Chance", true, 50)); // not properly implemented just 50 penalty
            Board.access().addProperty(resFactory.create("Pukekura Park, Festival of Lights", 350, 35, 200));
            Board.access().addProperty(luckFactory.create("Super Tax", true, 100));
            Board.access().addProperty(resFactory.create("Rangitoto", 400, 40, 200));

            Console.WriteLine("Properties have been setup");
        }
Ejemplo n.º 5
0
 public void testTransportFactory()
 {
     TransportFactory transFactory = new TransportFactory();
 }