Exemple #1
0
    def add_items(self):
        item1 = Items('Iphone10', 'A brand new Iphone')
        item2 = Items('Storagekey',
                      'This is a key which unlocks the storage room door')

        self.items.append(item1)
        self.items.append(item2)
Exemple #2
0
    def add_items(self):
        item1 = Items('Tube of water','A tube filled with dirty water! Do not drink it')
        item2  = Items('Key','This is a key you can use it to open your way to the roof ')
        item3 = Items('Parachute','This is a very reliable military parachute')

        self.items.append(item1)
        self.items.append(item2)
        self.items.append(item3)
Exemple #3
0
    def add_items(self):
        item1 = Items('Military bag',
                      'A big bag used by the military forces in WWII')
        item2 = Items('Sunglases', 'A big travelling suitcase')
        item3 = Items('Wire rope', 'A very durable and reliable rope')

        self.items.append(item1)
        self.items.append(item2)
        self.items.append(item3)
Exemple #4
0
    def add_items(self):

        from Items import Items
        item1 = Items('Nice warm jacket', 'A very warm jacket')
        item2 = Items(
            'Hammer',
            'A legit heavy hummer used as a weapon in the 18th century! The kids can not lift it obviously, but you can!'
        )
        item3 = Items('Gun(toy)', 'Just a toy gun loaded with rubber arrows')
        self.items.append(item1)
        self.items.append(item2)
        self.items.append(item3)
Exemple #5
0
    def add_items(self):


        item1 = Items('Machete','This is a big and sharp machete you can use it to free yourself')
        item2  = Items('Basementkey','This is a key use it to open the door')
        item3 = Items('Lighter','This is a lighter use it to see where you are')
        item4 = Items('Axe','This is an axe use it to cut and break things')

        self.items.append(item1)
        self.items.append(item2)
        self.items.append(item3)
        self.items.append(item4)
Exemple #6
0
    def add_items(self):
        item1 = Items('Finalroomkey', 'A key for the Finalroom door')
        item2 = Items('Bottle', 'Empty bottle')
        item3 = Items('Granade',
                      'This is a lighter use it to see where you are')
        item4 = Items(
            'AK-47',
            'The AK-47 is a gas-operated, 7.62×39mm assault rifle, developed in the Soviet Union by Mikhail Kalashnikov. It is the originating firearm of the Kalashnikov rifle (or "AK") family.'
        )

        self.items.append(item1)
        self.items.append(item2)
        self.items.append(item3)
        self.items.append(item4)
Exemple #7
0
	def _calc_src_dest(path):
		items = Items()
		for step in path:
			for (item, item_cardinality) in step.recipe.src.items():
				items.add(-step.cardinality * item_cardinality, item)
			for (item, item_cardinality) in step.recipe.dest.items():
				items.add(step.cardinality * item_cardinality, item)
		return items.src_dest()
 def insertar_items():
     while True:
         item = Items(input("Nombre: "), input("Tipo: "), input("Costo: "),
                      input("Activa: "), input("Pasiva: "))
         if (not (procesamiento.existe_nombre(path_items, item.nombre, 0))):
             break
         else:
             print("El item ya está registrado, ingrese otro por favor.")
     return procesamiento.insertar(path_items, str(item))
 def actualizar_items():
     while True:
         item = Items(input("Nombre: "), input("Tipo: "), input("Costo: "),
                      input("Activa: "), input("Pasiva: "))
         if (procesamiento.existe_nombre(path_items, item.nombre, 0)):
             break
         else:
             print(
                 "El item no se encuentra registrado, ingrese otro por favor."
             )
     return procesamiento.actualizar(path_items, str(item))
Exemple #10
0
 def actualizar(self):
     if self.muriendo == True:
         self.ani_num += 1
         if self.ani_num == 2:
             self.sonido_al_morir.play()
         if self.ani_num == self.ani_max:
             self.muerto = True
             self.muriendo = False
             self.items.append(
                 Items("imagenes/item", self.getPosicion(), self.camara))
             self.setPosicion([-100, -100])
             self.ani_num = 0
     if self.muerto == False:
         self.mover()
Exemple #11
0
 def __init__(self, p, args={}):
     self.info = args
     self.items = Items()
     self.player = p
     s_width = args['sidebar_width']
     b_height = args['button_height']
     width = args['width']
     height = args['height']
     self.submenu = "player"
     #create all the little subsections of the menu
     self.menu_back = pygame.Surface((width, height))
     self.sidebar = self.menu_back.subsurface(
         pygame.Rect(0, 0, s_width, height))
     self.buttons = self.menu_back.subsurface(
         pygame.Rect(s_width, 0, width - s_width, b_height))
     self.action_items = self.menu_back.subsurface(
         pygame.Rect(s_width, b_height, (width / 2) - s_width,
                     height - b_height))
     self.menu_area = self.menu_back.subsurface(
         pygame.Rect(s_width, b_height, width - s_width, height - b_height))
     #print self.action_items.get_rect()
     #print self.menu_back.get_rect()
     #print self.sidebar.get_rect()
     #print self.buttons.get_rect()
     self.options = self.menu_back.subsurface(
         pygame.Rect(
             (self.sidebar.get_width() + self.action_items.get_width()),
             b_height, width -
             (self.sidebar.get_width() + self.action_items.get_width()),
             height - b_height))
     #initialize sprite box
     self.sprites = pygame.sprite.RenderUpdates()
     #build buttons to click
     #self.sidebar.fill((255, 0, 0))
     #self.buttons.fill((0, 255, 0))
     #self.action_items.fill((0, 0, 255))
     #self.options.fill((255, 255, 0))
     items = self.make_button("Items", self.buttons, 0, 0)
     equip = self.make_button("Equipment", self.buttons,
                              items.rect.width + 2, 0)
     skill = self.make_button("Skills", self.buttons,
                              items.rect.width + equip.rect.width + 6, 0)
     play = self.make_button(
         "Player", self.buttons,
         items.rect.width + equip.rect.width + skill.rect.width + 10, 0)
     #build submenu that defaults to - Player Info
     self.run_play()
 def setUp(self):
     self.items = Items(209321299,
                        "Sour Patch Watermelon Soft & Chewy Candy - 8oz",
                        1.99)
Exemple #13
0
	catalog_format_type_dao = dao_session.getCatalogFormatTypeDao()
	catalog_status_type_dao = dao_session.getCatalogStatusTypeDao()
	users_dao = dao_session.getUsersDao()

	list_it_types = catalog_item_type_dao.readAll()
	format_type = catalog_format_type_dao.readRandom()
	list_catalog_status_type = catalog_status_type_dao.readAll()
	list_users = users_dao.readAll()

	list_items = []
	number_items = 10000
	number_assets = 1000

	for j in range(number_assets):
		time.sleep(.001)
		item_item = Items()
		# item_item.setId(i)
		item_item.setClass(1)
		item_item.setName('Asset_' + str(j))
		item_item.setPath('Path_' + str(j))
		item_item.setDateTime(datetime.datetime.now())
		item_item.setType(list_it_types[randint(0, len(list_it_types) - 1)].getId())
		item_item.setFormat(randint(0, len(format_type.getField(list_it_types[item_item.getType()].getItemType())) - 1))
		item_item.setStatus(list_catalog_status_type[randint(0, len(list_catalog_status_type) - 1)].getId())
		item_item.setVersion(0.1)
		item_item.setPrevVersion('')
		item_item.setNextVersion('')
		for i in range(0, randint(0, len(list_users) - 1)):
			item_item.addUserSubscription(randint(0, len(list_users) - 1))

		list_items.append(item_item)
Exemple #14
0
 def setUp(self):
     self.item = Items(1, '12.95', 'Beer', 'Coors', 'Molson')
Exemple #15
0
def makeWebhookResult(req, menu):
    '''
    Returns a dictionary based on individual intent action
    '''
    # Deal with the intent - showMenu
    if req['queryResult']['action'] == 'showMenuAction':
        speech = "The details you asked are : \n\n " + "\n".join(
            [str(i) for i in list(menu.extractMenu())])
        return makeSpeech(speech)
    # Deal with the intent - showCategory
    elif req['queryResult']['action'] == 'expandMenuAction':
        result = req['queryResult']
        parameters = result.get('parameters')
        category = parameters.get('categoryEntity')
        cat = Category()
        cat.extractCatergoryId(category)
        speech = "The details you asked are : \n\n " + "\n".join(
            [str(i) for i in list(cat.getdata())])
        return makeSpeech(speech)
    # Deal with the intent - exploreItem
    elif req['queryResult']['action'] == 'exploreItemAction':
        result = req['queryResult']
        parameters = result.get('parameters')
        item = parameters.get('items')
        it = Items()
        plateDetails = it.exploreItem(item)
        speech = "Price for " + str(
            item) + "\n\n" + "for half plate: " + plateDetails[
                0] + "\nfull plate: " + plateDetails[1]
        return makeSpeech(speech)
    # Deal with the intent - addThisToCart
    # Used when user is exploring a specific item and then says to add the item which is being explored to the cart.
    elif req['queryResult']['action'] == 'addThisToCartAction':
        result = req['queryResult']
        parameters = result.get('parameters')
        quantity = parameters.get('quantity')
        platesize = parameters.get("plateSize")
        if quantity and platesize:
            item_name = req['queryResult']['outputContexts'][0]['parameters'][
                'items']
            email_id = fetchMail(req)
            it1 = Items()
            price_both = it1.exploreItem(
                item_name)  # item plate size and menuID
            if platesize == "full":
                price = price_both[1]
            elif platesize == "half" and price_both[0] != "Not Available":
                price = price_both[0]
            else:
                price = price_both[1]
                platesize = "full (Half-not available)"
            temp_dict = {
                'item_name': item_name,
                'quantity': quantity,
                'price': int(quantity) * int(price[1:]),
                'plate_size': platesize
            }
            email_dict[email_id].append(temp_dict)
            paymentPOST[email_id]['cart'] = [{
                'name': item_name,
                'id': price_both[2],
                'quantity': int(quantity),
                'type': "ANY",
                'price': int(price[1:])
            }]
            speech = "Cart Updated Successfully !"
            return makeSpeech(speech)

    # Deal with the intent - clearCart
    elif req['queryResult']['action'] == 'clearCartAction':
        email_id = fetchMail(req)
        if email_id in email_dict:
            del email_dict[email_id]
    # Deal with the intent - addItemToCart
    # Used when user says add @ITEM_NAME to cart directly.
    elif req['queryResult']['action'] == 'addItemToCartAction':
        result = req['queryResult']
        parameters = result.get('parameters')
        quantity = parameters.get('quantity')
        platesize = parameters.get("plateSize")
        if quantity and platesize:
            item_name = req['queryResult']['outputContexts'][0]['parameters'][
                'items']
            email_id = fetchMail(req)
            it2 = Items()
            price_both = it2.exploreItem(item_name)
            if platesize == "full":
                price = price_both[1]
            elif platesize == "half" and price_both[0] != "Not Available":
                price = price_both[0]
            else:
                price = price_both[1]
                platesize = "full (Half-not available)"
            # Cart updation to show user
            temp_dict = {
                'item_name': item_name,
                'quantity': quantity,
                'price': int(quantity) * int(price[1:]),
                'plate_size': platesize
            }
            email_dict[email_id].append(temp_dict)
            paymentPOST[email_id]['cart'] = [{
                'name': item_name,
                'id': price_both[2],
                'quantity': int(quantity),
                'type': "ANY",
                'price': int(price[1:])
            }]
            speech = "Cart Updated Successfully !"
            return makeSpeech(speech)

    # Deal with the intent - placeOrder
    elif req['queryResult']['action'] == 'placeOrderAction':
        result = req['queryResult']
        parameters = result.get('parameters')
        name = parameters.get("name")
        mobile = parameters.get("mobile")
        address = parameters.get("address")
        landmark = parameters.get('landmark')
        city = parameters.get('city')
        pincode = parameters.get('pincode')
        if name and mobile and address and city and pincode:
            email_id = fetchMail(req)
            # Updating Payment Api format for POST request
            paymentPOST[email_id]['customer'] = [{
                'name': name,
                'number': mobile,
                'email': email_id,
                'address': address,
                'landmark': landmark,
                'city': city,
                'pincode': int(pincode)
            }]
            makeSpeech("Redirecting to payment gateway...")
            # Post request to payment API
            linkRequest = requests.post(url=menu.paymentAPI,
                                        data=json.dumps(paymentPOST[email_id]))
            return makeSpeech(
                "This is your payment link click on the link and complete your payment. Thankyou for ordering !\n\n"
                + str(linkRequest.text))

    # Deal with the intent - shoeCart
    elif req['queryResult']['action'] == 'showCartAction':
        result = req['queryResult']
        email_id = fetchMail(req)
        no = 1
        speech = ""
        for i in email_dict[email_id]:
            speech += "Item: " + str(no) + "\n"
            for k in i:
                speech += str(k) + "-" + str(i[k]) + "\n"
            no += 1
        return makeSpeech(speech)
Exemple #16
0
from World import World
from Player import Player
from Items import Items

items = [
    Items("club", "melee", 1, 0, 1),
    Items("dagger", "melee", 3, 0, 4),
    Items("greatclub", "melee", 5, 0, 12),
    Items("handaxe", "melee", 8, 0, 18),
    Items("greatsword", "melee", 12, 0, 25),
    Items("Maul", "melee", 9, 0, 20),
    Items("woodshield", "melee", 0, 2, 5),
    Items("metalshield", "melee", 0, 5, 13),
    Items("ironshield", "melee", 0, 9, 25),
    Items("steelshield", "melee", 0, 15, 40)
]

t = Player("name", 1, 0, [5, 5])

world = World(t)

world.menu()
Exemple #17
0
 def add_items(self):
     item1  = Items('Board','A big board')
     self.items.append(item1)