コード例 #1
0
        public Game()
		{
            inventory = new List<Item>();

			Console.WriteLine("Welcome adventurer, prepare yourself for a fantastical journey into the unknown.");

            // build the "map"
            // add locations and items
            // currently items must only be one word, spaces will break them

            Location l1_a1 = new Location("The Car", "You are at the end of a long alleyway, behind the car is a sheer drop, best not go that way.");// crashed car
            Key l1_screwDriver = new Key("Screw Driver", "This might come in handy.", false);
            l1_a1.addItem(l1_screwDriver);

            Location l1_a2 = new Location("The Alleyway", "A dark alleyway leading north to a gate and south to the car.");
            Key l1_brokenPipe = new Key("Broken Pipe", "A piece of steel piping, it looks like it broke off of the piping above.", true);
            l1_a2.addItem(l1_brokenPipe);

            Location l2_a1 = new Location("End of the alleyway", "There is a Metal gate standing North of you,\nblocking the exit from the alleyway.\nA Rusted chain with a Damaged Lock on it.\nIt looks like it could be easily broken with something...");// gate at end locking the exit

            Location l3_a1 = new Location("Barricaded Street", "A wide street with barricades not far east and west blocking the roads.\nThe street is surrounded by tall buildings.");

            l1_a1.addExit(new Exit(Exit.Directions.North, l1_a2));

            l1_a2.addExit(new Exit(Exit.Directions.South, l1_a1));
            l1_a2.addExit(new Exit(Exit.Directions.North, l2_a1));

            l2_a1.addExit(new Exit(Exit.Directions.South, l1_a2));
            l2_a1.addExit(new Exit(Exit.Directions.North, l3_a1, l1_brokenPipe));

            l3_a1.addExit(new Exit(Exit.Directions.South, l2_a1));

            currentLocation = l1_a1;

            showLocation(false);
		}
コード例 #2
0
 public Exit(Directions _direction, Location newLeadsTo, Key _key)
 {
     direction = _direction;
     leadsTo = newLeadsTo;
     key = _key;
 }
コード例 #3
0
 public Exit(Directions _direction, Location newLeadsTo)
 {
     direction = _direction;
     leadsTo = newLeadsTo;
     key = null;
 }
コード例 #4
0
 public Exit()
 {
     direction = Directions.Undefined;
     leadsTo = null;
     key = null;
 }