当前位置: 首页>>代码示例>>Python>>正文


Python CatalogItemList.CatalogItemList类代码示例

本文整理汇总了Python中toontown.catalog.CatalogItemList.CatalogItemList的典型用法代码示例。如果您正苦于以下问题:Python CatalogItemList类的具体用法?Python CatalogItemList怎么用?Python CatalogItemList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CatalogItemList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getItems

    def getItems(self):
        items = CatalogItemList(store=CatalogItem.Customization|CatalogItem.Location)

        for item in self.items:
            items.append(item.catalogItem)

        return items.getBlob()
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:7,代码来源:DistributedFurnitureManagerAI.py

示例2: loadFromHouse

 def loadFromHouse(self):
     self.b_setAtticItems(self.house.getAtticItems())
     self.b_setAtticWallpaper(self.house.getAtticWallpaper())
     self.b_setAtticWindows(self.house.getAtticWindows())
     self.b_setDeletedItems(self.house.getDeletedItems())
     self.wallpaper = CatalogItemList(self.house.getInteriorWallpaper(), store=CatalogItem.Customization)
     self.applyWallpaper()
     self.windows = CatalogItemList(self.house.getInteriorWindows(), store=CatalogItem.Customization | CatalogItem.WindowPlacement)
     self.applyWindows()
     self.setItems(self.house.getInteriorItems())
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:10,代码来源:DistributedFurnitureManagerAI.py

示例3: __init__

class DNAFurnitureReaderAI:
    # This object processes the house_interior*.dna files and produces a
    # CatalogItemList representing the furniture in the DNA file. The resulting
    # list is passed to the FurnitureManager in order to initialize a blank
    # house to the default furniture arrangement.
    notify = directNotify.newCategory("DNAFurnitureReaderAI")

    def __init__(self, dnaData, gender, phonePos):
        self.dnaData = dnaData
        self.gender = gender
        self.phonePos = phonePos
        self.itemList = None

    def buildList(self):
        self.itemList = CatalogItemList(store=(CatalogItem.Customization |
                                               CatalogItem.Location))

        # Find the interior node:
        for i in xrange(self.dnaData.getNumChildren()):
            child = self.dnaData.at(i)
            if child.getName() == 'interior':
                interior = child
                break
        else:
            self.notify.error('Could not find "interior" in DNA!')

        self.itemList.append(CatalogFurnitureItem(1399, posHpr=self.phonePos))
        # Every child in the interior node is a prop, thus:
        for i in xrange(interior.getNumChildren()):
            child = interior.at(i)
            code = child.getCode()

            if code not in DNA2Furniture:
                self.notify.warning('Unrecognized furniture code %r!' % code)
                continue

            itemId = DNA2Furniture[code]
            if itemId is None:
                continue
            if hasattr(itemId, '__getitem__'):
                itemId = itemId[self.gender]

            x, y, z = child.getPos()
            h, p, r = child.getHpr()
            self.itemList.append(CatalogFurnitureItem(itemId,
                                                      posHpr=(x, y, z, h, p, r)))

    def getList(self):
        if not self.itemList:
            self.buildList()
        return self.itemList

    def getBlob(self):
        return self.getList().getBlob()
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:54,代码来源:DNAFurnitureReaderAI.py

示例4: setItems

    def setItems(self, items):
        # Decode the blob:
        items = CatalogItemList(items, store=CatalogItem.Customization|CatalogItem.Location)

        # Throw out our old items:
        for item in self.items:
            item.destroy()
        self.items = []

        items.removeDuplicates(FLCloset)

        # Due to a bug, some people are missing their closets...
        hasCloset = False
        for item in items:
            if item.getFlags() & FLCloset:
                hasCloset = True
                break

        if not hasCloset and self.ownerId != 0:
            item = CatalogFurnitureItem(500)  # the basic closet...
            item.posHpr = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
            items.append(item)
            # Since we have modified the items list, should we save it back to the house?

        for item in items:
            if item.getFlags() & FLTrunk:
                if self.house.gender is 0:
                    if item.furnitureType - 4000 < 10:
                        item.furnitureType += 10
                elif item.furnitureType - 4000 > 10:
                    item.furnitureType -= 10
                do = DistributedTrunkAI(self.air, self, item)
            elif item.getFlags() & FLCloset:
                if self.house.gender is 0:
                    if item.furnitureType - 500 < 10:
                        item.furnitureType += 10
                elif item.furnitureType - 500 > 10:
                    item.furnitureType -= 10
                do = DistributedClosetAI(self.air, self, item)
            elif item.getFlags() & FLBank:
                continue # We dont want banks in the estates.
            elif item.getFlags() & FLPhone:
                do = DistributedPhoneAI(self.air, self, item)
            else:
                do = DistributedFurnitureItemAI(self.air, self, item)
            if self.isGenerated():
                do.generateWithRequired(self.zoneId)
            self.items.append(do)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:48,代码来源:DistributedFurnitureManagerAI.py

示例5: buildList

    def buildList(self):
        self.itemList = CatalogItemList(store=(CatalogItem.Customization |
                                               CatalogItem.Location))

        # Find the interior node:
        for i in xrange(self.dnaData.getNumChildren()):
            child = self.dnaData.at(i)
            if child.getName() == 'interior':
                interior = child
                break
        else:
            self.notify.error('Could not find "interior" in DNA!')

        self.itemList.append(CatalogFurnitureItem(1399, posHpr=self.phonePos))
        # Every child in the interior node is a prop, thus:
        for i in xrange(interior.getNumChildren()):
            child = interior.at(i)
            code = child.getCode()

            if code not in DNA2Furniture:
                self.notify.warning('Unrecognized furniture code %r!' % code)
                continue

            itemId = DNA2Furniture[code]
            if itemId is None:
                continue

            x, y, z = child.getPos()
            h, p, r = child.getHpr()
            self.itemList.append(CatalogFurnitureItem(itemId,
                                                      posHpr=(x, y, z, h, p, r)))
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:31,代码来源:DNAFurnitureReaderAI.py

示例6: __init__

 def __init__(self, air):
     DistributedObjectAI.__init__(self, air)
     self.houseType = 0
     self.gardenPos = 0
     self.avatarId = 0
     self.name = ''
     self.color = 0
     self.housePos = 0
     self.gender = 1
     self.isInteriorInitialized = 1
     self.atticItems = CatalogItemList(store=Customization)
     self.interiorItems = CatalogItemList(store=Customization)
     self.interiorWallpaper = CatalogItemList(store=Customization)
     self.atticWallpaper = CatalogItemList(store=Customization)
     self.interiorWindows = CatalogItemList(store=Customization)
     self.atticWindows = CatalogItemList(store=Customization)
     self.deletedItems = CatalogItemList(store=Customization)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:17,代码来源:DistributedHouseAI.py

示例7: __init__

    def __init__(self, air):
        DistributedObjectAI.__init__(self, air)

        self.houseType = 0
        self.gardenPos = 0
        self.avatarId = 0
        self.name = ""
        self.color = 0
        self.housePos = 0
        self.gender = 1
        self.isInteriorInitialized = 1  # Only fresh DB houses are not inited.

        # FIXME: Now I think I did this wrong...
        self.atticItems = CatalogItemList(store=Customization)
        self.interiorItems = CatalogItemList(store=Customization)
        self.interiorWallpaper = CatalogItemList(store=Customization)
        self.atticWallpaper = CatalogItemList(store=Customization)
        self.interiorWindows = CatalogItemList(store=Customization)
        self.atticWindows = CatalogItemList(store=Customization)
        self.deletedItems = CatalogItemList(store=Customization)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:20,代码来源:DistributedHouseAI.py

示例8: setInteriorWindows

 def setInteriorWindows(self, interiorWindows):
     self.interiorWindows = CatalogItemList(interiorWindows, store=Customization | WindowPlacement)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:2,代码来源:DistributedHouseAI.py

示例9: setAtticWindows

 def setAtticWindows(self, atticWindows):
     self.atticWindows = CatalogItemList(atticWindows, store=Customization)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:2,代码来源:DistributedHouseAI.py

示例10: setInteriorWallpaper

 def setInteriorWallpaper(self, interiorWallpaper):
     self.interiorWallpaper = CatalogItemList(interiorWallpaper, store=Customization)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:2,代码来源:DistributedHouseAI.py

示例11: setAtticWallpaper

 def setAtticWallpaper(self, atticWallpaper):
     self.atticWallpaper = CatalogItemList(atticWallpaper, store=Customization)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:2,代码来源:DistributedHouseAI.py

示例12: setInteriorItems

 def setInteriorItems(self, interiorItems):
     self.interiorItems = CatalogItemList(interiorItems, store=Customization | Location)
开发者ID:CalmBit,项目名称:ToonboxSource,代码行数:2,代码来源:DistributedHouseAI.py

示例13: DistributedFurnitureManagerAI

class DistributedFurnitureManagerAI(DistributedObjectAI):
    notify = directNotify.newCategory("DistributedFurnitureManagerAI")

    def __init__(self, air, house, interior):
        DistributedObjectAI.__init__(self, air)

        self.house = house
        self.interior = interior

        self.director = None

        self.ownerId = house.avatarId
        self.ownerName = house.name

        self.atticItems = None
        self.atticWallpaper = None
        self.wallpaper = None
        self.atticWindows = None
        self.windows = None
        self.deletedItems = None

        self.items = []

        # Initialize the above variables:
        self.loadFromHouse()

    def announceGenerate(self):
        DistributedObjectAI.announceGenerate(self)

        for item in self.items:
            item.generateWithRequired(self.zoneId)

    def delete(self):
        for item in self.items:
            item.destroy()

        DistributedObjectAI.delete(self)

    def loadFromHouse(self):
        self.b_setAtticItems(self.house.getAtticItems())
        self.b_setAtticWallpaper(self.house.getAtticWallpaper())
        self.b_setAtticWindows(self.house.getAtticWindows())
        self.b_setDeletedItems(self.house.getDeletedItems())

        self.wallpaper = CatalogItemList(self.house.getInteriorWallpaper(),
                                         store=CatalogItem.Customization)
        self.applyWallpaper()
        self.windows = CatalogItemList(self.house.getInteriorWindows(),
                                       store=CatalogItem.Customization |
                                             CatalogItem.WindowPlacement)
        self.applyWindows()

        self.setItems(self.house.getInteriorItems())

    def saveToHouse(self):
        self.house.b_setAtticItems(self.getAtticItems())
        self.house.b_setAtticWallpaper(self.getAtticWallpaper())
        self.house.b_setAtticWindows(self.getAtticWindows())
        self.house.b_setDeletedItems(self.getDeletedItems())

        self.house.b_setInteriorWallpaper(self.wallpaper.getBlob())
        self.house.b_setInteriorWindows(self.windows.getBlob())

        self.house.b_setInteriorItems(self.getItems())

    def applyWallpaper(self):
        self.interior.b_setWallpaper(self.wallpaper.getBlob())

    def applyWindows(self):
        self.interior.b_setWindows(self.windows.getBlob())

    def setItems(self, items):
        # Decode the blob:
        items = CatalogItemList(items, store=CatalogItem.Customization|CatalogItem.Location)

        # Throw out our old items:
        for item in self.items:
            item.destroy()
        self.items = []

        items.removeDuplicates(FLCloset)

        # Due to a bug, some people are missing their closets...
        hasCloset = False
        for item in items:
            if item.getFlags() & FLCloset:
                hasCloset = True
                break

        if not hasCloset:
            item = CatalogFurnitureItem(500)  # the basic closet...
            item.posHpr = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
            items.append(item)
            # Since we have modified the items list, should we save it back to the house?

        for item in items:
            if item.getFlags() & FLTrunk:
                if self.house.gender is 0:
                    if item.furnitureType - 4000 < 10:
                        item.furnitureType += 10
#.........这里部分代码省略.........
开发者ID:swingmaster66,项目名称:LimitNetworkTT-1.4.6,代码行数:101,代码来源:DistributedFurnitureManagerAI.py

示例14: setDeletedItems

 def setDeletedItems(self, items):
     self.deletedItems = CatalogItemList(items, store=CatalogItem.Customization)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:2,代码来源:DistributedFurnitureManagerAI.py

示例15: setAtticWallpaper

 def setAtticWallpaper(self, items):
     self.atticWallpaper = CatalogItemList(items, store=CatalogItem.Customization)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:2,代码来源:DistributedFurnitureManagerAI.py


注:本文中的toontown.catalog.CatalogItemList.CatalogItemList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。