예제 #1
0
        public PantsWithTwoPockets(string name, string description, string[] parsedNames = null,
            bool isSpecific = false, bool isPlural = true, bool isProper = false,
            bool canBeTaken = true, bool canBeDropped = true, bool canBeRemoved = true)
            : base(name, description, parsedNames:parsedNames,
			isSpecific: isSpecific, isPlural: isPlural, isProper: isProper,
			canBeTaken: canBeTaken, canBeDropped: canBeDropped, canBeRemoved: canBeRemoved)
        {
            this.leftPocket  = new BasicContainer("left pocket",  "It's a pocket.", new string[] { "left pocket",  "pocket", "left pocket of "  + name, "left pocket of the "  + name }, canBeTaken:false);
            this.rightPocket = new BasicContainer("right pocket", "It's a pocket.", new string[] { "right pocket", "pocket", "right pocket of " + name, "right pocket of the " + name }, canBeTaken:false);
        }
예제 #2
0
        /// <summary>
        /// Helper method that initializes the <see cref="player"/> character
        /// and the <see cref="Room"/>s of the game.
        /// </summary>
        private static void initPlayerAndRooms()
        {
            player = new Person("You", "How did you get this to display? It's supposed to be masked.", PronounSet.GetSecondPersonSet(), new string[] { "me" });
            firstRoom = new Room("Kitchen", "The kitchen is a room where people make food.");
            Room anotherRoom = new Room("Bedroom", "This is a place where people typically sleep. Its name comes from the piece of furniture, a bed, that usually occupies the room. However, while providing a place to rest is certainly one of a bedroom's important functions, it is also expected to provide several other services. As you may have already guessed, I needed a long description to test my description-displaying.");
            Room aThirdRoom = new Room("Hallway", "Just a heads up: this is the room I used for testing non-euclidean room connections. It worked.");

            Room.SetAdjacent(firstRoom, Direction.south, anotherRoom, Direction.north);
            Room.SetAdjacent(aThirdRoom, Direction.east, anotherRoom, Direction.west);
            aThirdRoom.SetAdjacent(firstRoom, Direction.southwest);

            Move(new Thing("table", "a kitchen table", canBeTaken:false), firstRoom);
            Move(new Thing(), firstRoom);
            Move(new Thing(), firstRoom);

            Move(new Thing("bed", "a thing that you sleep on", canBeTaken:false), anotherRoom);
            Move(new Person("Steve", "The first NPC I made for testing.", PronounSet.GetMaleSet()), anotherRoom);

            BasicContainer basket = new BasicContainer("basket", "A woven basket.");
            Move(basket, aThirdRoom);
            Move(new Thing("flower", "It's a dandylion."), basket);
            BasicOpenableContainer box = new BasicOpenableContainer("box", "I'm just going through classes I've made, instantiating them.", true);
            Move(box, aThirdRoom);
            Move(new Thing("plates", "Some nice dinner plates. This one was for testing plural nouns.", isPlural: true), box);
            Move(new Clothing("dress", "A cotton dress.", slots:new ClothingSlot[] { ClothingSlot.shirt, ClothingSlot.skirt}), aThirdRoom);

            Move(player, firstRoom);
        }