Ejemplo n.º 1
0
    def __init__(self, name, description, greetings, region, numItems, 
        quality):
        """
        Initializes shop.

        @param name:        The name of the shop.
        @param description: The description of the shop.
        @param greetings:   The greetings the user gets as he enters a shop.
        @param region:      The region the shop is in.
        @param numItems:    The number of items that can be bought at the 
                            shop.
        @param quality:     The quality of the items that may be bought at 
                            shop.
                            Ranges from 1-20.
        """
        Building.__init__(self, name, description, greetings)

        #Create items attributes and generate items objects
        self._region = region
        self._numItems = numItems
        self._quality = quality
        
        self._items = factories.shop_factory.getItems(region, numItems, 
            quality)
        
        #Sort items
        sortItems(self._items)
Ejemplo n.º 2
0
    def __init__(self, name, description, greetings, cost):
        """
        Initializes inn object.

        @param name:           The name of the inn.
        @param description:    A description of the inn.
        @param greetings:      The greetings the user gets as he enters the inn.
        @param cost:           The cost of using the inn.
        """
        Building.__init__(self, name, description, greetings)
        self._cost = cost
Ejemplo n.º 3
0
    def __init__(self, name, description, greetings, cost):
        """
        Initializes inn object.

        @param name:           The name of the inn.
        @param description:    A description of the inn.
        @param greetings:      The greetings the user gets as he enters the inn.
        @param cost:           The cost of using the inn.
        """
        Building.__init__(self, name, description, greetings)
        self._cost = cost
Ejemplo n.º 4
0
    def __init__(self, name, description, greetings, talk = None):
        """
        Initializes square object.

        @param name:           The name of the square.
        @param description:    A description of the square.
        @param greetings:      The greetings the user gets as he enters a square.
        @param talk:           A dictionary of people names and strings that are returned if a player talks in square.
        """
        Building.__init__(self, name, description, greetings)

        self._talk = talk
Ejemplo n.º 5
0
    def __init__(self, name, description, greetings, numItems, quality):
        """
        Initializes shop object.

        @param name:           The name of the shop.
        @param description:    A description of the shop.
        @param greetings:      The greetings the user gets as he enters a shop.
        @param numItems:       The number of items that can be bought at the shop.
        @param quality:        The quality of the items that may be bought at shop.
                               Ranges from 1-20.
        """
        Building.__init__(self, name, description, greetings)

        #Create items attributes and generate items objects
        self._numItems = numItems
        self._quality = quality
        self._items = factories.shop_factory.getItems(numItems, quality)
Ejemplo n.º 6
0
    def __init__(self, name, description, greetings, talk = None, 
    items = None):
        """
        Initializes square object.

        @param name:           The name of the square.
        @param description:    A description of the square.
        @param greetings:      The greetings the user gets as he enters a 
                               square.
        @param talk:           A dictionary of names-responses used for 
                               dialogue.
        @param items:          Items that the player may receive for talking 
                               to people.
        """
        Building.__init__(self, name, description, greetings)

        self._talk = talk
        self._items = items