Exemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     CreateObjects();
     opponent = new Opponent(FrontYard);
     ResetGame(false);
 }
Exemplo n.º 2
0
        public void CreateObject()
        {
            garden    = new OutsideWithHidingPlace("Garden", false, "inside the shed");
            frontYard = new OutsideWithDoor("FrontYard", false, "an heavy-looking oak door");
            backYard  = new OutsideWithDoor("BackYard", true, "a screen door");
            driveway  = new OutsideWithHidingPlace("Driveway", true, "in the garage");

            diningRoom    = new RoomWithHidingPlace("DiningRoom", "a crystal chandelier", "in the tall armoire");
            livingRoom    = new RoomWithDoor("Living Room", "an antique carpet", "inside the closet", "an oak door with a brass knob");
            kitchen       = new RoomWithDoor("Kitchen", "stainless steel appliances", "in the cabinet", "a screen door");
            stairs        = new Room("Stairs", "a wooden bannister");
            hallway       = new RoomWithHidingPlace("Upstairs Hallway", "a picture of dog", "in the closet");
            bathroom      = new RoomWithHidingPlace("Bathroom", "a sink and a toilet", "in the shower");
            masterBedroom = new RoomWithHidingPlace("MasterBedroom", "a large bed", "under the bed");
            secondBedroom = new RoomWithHidingPlace("Second Bedroom", "a small bed", "under the bed");


            garden.Exits    = new Location[] { frontYard, backYard };
            frontYard.Exits = new Location[] { garden, backYard, driveway };
            backYard.Exits  = new Location[] { garden, frontYard, driveway };
            driveway.Exits  = new Location[] { backYard, frontYard };

            diningRoom.Exits    = new Location[] { livingRoom, kitchen };
            livingRoom.Exits    = new Location[] { diningRoom, stairs };
            kitchen.Exits       = new Location[] { diningRoom };
            stairs.Exits        = new Location[] { livingRoom, hallway };
            hallway.Exits       = new Location[] { stairs, bathroom, masterBedroom, secondBedroom };
            bathroom.Exits      = new Location[] { hallway };
            masterBedroom.Exits = new Location[] { hallway };
            secondBedroom.Exits = new Location[] { hallway };

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation  = livingRoom;

            kitchen.DoorLocation  = backYard;
            backYard.DoorLocation = kitchen;

            opponent = new Opponent(frontYard);

            checkButton.Visible            = false;
            goHereButton.Visible           = false;
            exits.Visible                  = false;
            goThroughTheDoorButton.Visible = false;

            Moves = 0;
        }
Exemplo n.º 3
0
        private void ResetGame(bool displayMessage)
        {
            if (displayMessage)
            {
                MessageBox.Show("You found me in " + moves + " moves!");
                description.Text = "You found your opponent in " + moves + " moves! He was hiding " + currentHidingPlaceChecked + ".";
            }

            opponent = new Opponent(frontYard);
            moves    = 0;

            goHere.Visible           = false;
            exits.Visible            = false;
            goThroughTheDoor.Visible = false;
            check.Visible            = false;

            hide.Visible = true;
        }
Exemplo n.º 4
0
        private void CreateObjects()
        {
            livingRoom      = new RoomWithDoor("Living Room", "an antique carpet", "an oak door with a brass knob", "inside the closet");
            kitchen         = new RoomWithDoor("Kitchen", "stainless steel appliances", "a screen door", "in the cabinet");
            diningRoom      = new RoomWithHidingPlace("Dining Room", "a crystal chandelier", "in the tall armoire");
            stairs          = new Room("Stairs", "a wooden bannister");
            upstairsHallway = new RoomWithHidingPlace("Upstairs Hallway", "a picture of a dog", "in the closet");
            masterBedroom   = new RoomWithHidingPlace("Master Bedroom", "a large bed", "under the bed");
            secondBedroom   = new RoomWithHidingPlace("Second Bedroom", "a small bed", "under the bed");
            bathroom        = new RoomWithHidingPlace("Bathroom", "a sink and a toilet", "in the shower");

            frontYard = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
            backYard  = new OutsideWithDoor("Back Yard", true, "a screen door");
            garden    = new OutsideWithHidingPlace("Garden", false, "inside the shed");
            driveway  = new OutsideWithHidingPlace("Driveway", false, "in the garage");

            livingRoom.Exits      = new Location[] { diningRoom, stairs };
            stairs.Exits          = new Location[] { livingRoom, upstairsHallway };
            kitchen.Exits         = new Location[] { diningRoom };
            diningRoom.Exits      = new Location[] { livingRoom, kitchen };
            upstairsHallway.Exits = new Location[] { masterBedroom, secondBedroom, bathroom, stairs };
            masterBedroom.Exits   = new Location[] { upstairsHallway };
            secondBedroom.Exits   = new Location[] { upstairsHallway };
            bathroom.Exits        = new Location[] { upstairsHallway };

            frontYard.Exits = new Location[] { backYard, garden, driveway };
            backYard.Exits  = new Location[] { frontYard, garden, driveway };
            garden.Exits    = new Location[] { frontYard, backYard };
            driveway.Exits  = new Location[] { frontYard, backYard };

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation  = livingRoom;

            kitchen.DoorLocation  = backYard;
            backYard.DoorLocation = kitchen;

            opponent = new Opponent(frontYard);
        }
Exemplo n.º 5
0
        private void CreateObjects()
        {
            livingRoom = new RoomWithDoor("Living Room", "an antique carpet", "an oak door with a brass knob", "inside the closet");
            kitchen = new RoomWithDoor("Kitchen", "stainless steel appliances", "a screen door", "in the cabinet");
            diningRoom = new RoomWithHidingPlace("Dining Room", "a crystal chandelier", "in the tall armoire");
            stairs = new Room("Stairs", "a wooden bannister");
            upstairsHallway = new RoomWithHidingPlace("Upstairs Hallway","a picture of a dog","in the closet");
            masterBedroom = new RoomWithHidingPlace("Master Bedroom", "a large bed", "under the bed");
            secondBedroom = new RoomWithHidingPlace("Second Bedroom", "a small bed", "under the bed");
            bathroom = new RoomWithHidingPlace("Bathroom", "a sink and a toilet", "in the shower");

            frontYard = new OutsideWithDoor("Front Yard", false, "an oak door with a brass knob");
            backYard = new OutsideWithDoor("Back Yard", true, "a screen door");
            garden = new OutsideWithHidingPlace("Garden", false, "inside the shed");
            driveway = new OutsideWithHidingPlace("Driveway", false, "in the garage");

            livingRoom.Exits = new Location[] { diningRoom, stairs };
            stairs.Exits = new Location[] { livingRoom, upstairsHallway };
            kitchen.Exits = new Location[] {diningRoom };
            diningRoom.Exits = new Location[] { livingRoom, kitchen };
            upstairsHallway.Exits = new Location[] { masterBedroom, secondBedroom, bathroom, stairs };
            masterBedroom.Exits = new Location[] { upstairsHallway };
            secondBedroom.Exits = new Location[] { upstairsHallway };
            bathroom.Exits = new Location[] { upstairsHallway };

            frontYard.Exits = new Location[] { backYard, garden, driveway };
            backYard.Exits = new Location[] { frontYard, garden, driveway };
            garden.Exits = new Location[] { frontYard, backYard };
            driveway.Exits = new Location[] { frontYard, backYard };

            livingRoom.DoorLocation = frontYard;
            frontYard.DoorLocation = livingRoom;

            kitchen.DoorLocation = backYard;
            backYard.DoorLocation = kitchen;

            opponent = new Opponent(frontYard);
        }
Exemplo n.º 6
0
        private void ResetGame(bool displayMessage)
        {
            if (displayMessage)
            {
                MessageBox.Show("You found me in " + moves + " moves!");
                description.Text = "You found your opponent in " + moves + " moves! He was hiding " + currentHidingPlaceChecked + ".";
            }

            opponent = new Opponent(frontYard);
            moves = 0;

            goHere.Visible = false;
            exits.Visible = false;
            goThroughTheDoor.Visible = false;
            check.Visible = false;

            hide.Visible = true;
        }