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


Python CatalogItemList.insert方法代码示例

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


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

示例1: DistributedFurnitureManagerAI

# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import insert [as 别名]

#.........这里部分代码省略.........
        item = self.getAtticFurniture(self.atticItems, index)

        self.atticItems.remove(item)
        self.d_setAtticItems(self.getAtticItems())

        item.posHpr = (x, y, z, h, p, r)

        do = DistributedFurnitureItemAI(self.air, self, item)
        do.generateWithRequired(self.zoneId)
        self.items.append(do)

        return (ToontownGlobals.FM_MovedItem, do.doId)

    def deleteItemFromAttic(self, blob, index):
        pass

    def deleteItemFromRoom(self, blob, doId):
        pass

    def moveWallpaperFromAttic(self, index, room):
        if room > 1:
            return ToontownGlobals.FM_InvalidIndex

        if index >= len(self.atticWallpaper):
            return ToontownGlobals.FM_InvalidIndex

        wallpaper = self.atticWallpaper.pop(index)
        if room < len(self.wallpaper):
            oldWallpaper = self.wallpaper.pop(room)

            self.atticWallpaper.append(oldWallpaper)
            self.b_setAtticWallpaper(self.atticWallpaper.getBlob())

        self.wallpaper.insert(room, wallpaper)
        self.applyWallpaper()

        return ToontownGlobals.FM_SwappedItem

    def deleteWallpaperFromAttic(self, blob, index):
        pass

    def moveWindowToAttic(self, slot):
        window = self.getWindow(slot)
        if window is None:
            return ToontownGlobals.FM_InvalidIndex

        self.windows.remove(window)
        self.applyWindows()
        self.atticWindows.append(window)
        self.d_setAtticWindows(self.getAtticWindows())

        return ToontownGlobals.FM_MovedItem

    def moveWindowFromAttic(self, index, slot):
        retcode = ToontownGlobals.FM_MovedItem

        window = self.getAtticFurniture(self.atticWindows, index)

        if slot > 5:
            # This is not a valid slot! HACKER!!!
            self.air.writeServerEvent(
                "suspicious", self.air.getAvatarIdFromSender(), "Tried to move window to invalid slot %d!" % slot
            )
            return ToontownGlobals.FM_HouseFull

        if self.getWindow(slot):
开发者ID:vincent15k,项目名称:Toontown-House,代码行数:70,代码来源:DistributedFurnitureManagerAI.py


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