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


Python CatalogItemList.removeDuplicates方法代码示例

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


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

示例1: setItems

# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import removeDuplicates [as 别名]
    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,代码行数:50,代码来源:DistributedFurnitureManagerAI.py


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