本文整理汇总了Python中toontown.catalog.CatalogItemList.CatalogItemList.getBlob方法的典型用法代码示例。如果您正苦于以下问题:Python CatalogItemList.getBlob方法的具体用法?Python CatalogItemList.getBlob怎么用?Python CatalogItemList.getBlob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.catalog.CatalogItemList.CatalogItemList
的用法示例。
在下文中一共展示了CatalogItemList.getBlob方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getItems
# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import getBlob [as 别名]
def getItems(self):
items = CatalogItemList(store=CatalogItem.Customization|CatalogItem.Location)
for item in self.items:
items.append(item.catalogItem)
return items.getBlob()
示例2: DistributedFurnitureManagerAI
# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import getBlob [as 别名]
class DistributedFurnitureManagerAI(DistributedObjectAI):
notify = DirectNotifyGlobal.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 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 = []
for item in items:
if item.furnitureType in furnitureId2Do:
do = furnitureId2Do[item.furnitureType](self.air, self, item, self.ownerId)
if self.isGenerated():
do.generateWithRequired(self.zoneId)
self.items.append(do)
else:
do = DistributedFurnitureItemAI(self.air, self, item)
if self.isGenerated():
do.generateWithRequired(self.zoneId)
self.items.append(do)
def getItems(self):
items = CatalogItemList(store=CatalogItem.Customization|CatalogItem.Location)
for item in self.items:
items.append(item.catalogItem)
return items.getBlob()
def setOwnerId(self, ownerId):
self.ownerId = ownerId
def d_setOwnerId(self, ownerId):
self.sendUpdate('setOwnerId', [ownerId])
def b_setOwnerId(self, ownerId):
#.........这里部分代码省略.........
示例3: DistributedHouseAI
# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import getBlob [as 别名]
#.........这里部分代码省略.........
def getName(self):
return self.name
def setColor(self, color):
self.color = color
def d_setColor(self, color):
self.sendUpdate('setColor', [color])
def b_setColor(self, color):
self.setColor(color)
self.d_setColor(color)
def getColor(self):
return self.color
def setGender(self, genderIndex):
self.gender = genderIndex
def getGender(self):
return self.gender
def setAtticItems(self, atticItems):
self.atticItems = CatalogItemList(atticItems, store=Customization)
def d_setAtticItems(self, atticItems):
self.sendUpdate('setAtticItems', [atticItems])
def b_setAtticItems(self, atticItems):
self.setAtticItems(atticItems)
self.d_setAtticItems(atticItems)
def getAtticItems(self):
return self.atticItems.getBlob()
def setInteriorItems(self, interiorItems):
self.interiorItems = CatalogItemList(interiorItems, store=Customization | Location)
def d_setInteriorItems(self, interiorItems):
self.sendUpdate('setInteriorItems', [interiorItems])
def b_setInteriorItems(self, interiorItems):
self.setInteriorItems(interiorItems)
self.d_setInteriorItems(interiorItems)
def getInteriorItems(self):
return self.interiorItems.getBlob()
def setAtticWallpaper(self, atticWallpaper):
self.atticWallpaper = CatalogItemList(atticWallpaper, store=Customization)
def d_setAtticWallpaper(self, atticWallpaper):
self.sendUpdate('setAtticWallpaper', [atticWallpaper])
def b_setAtticWallpaper(self, atticWallpaper):
self.setAtticWallpaper(atticWallpaper)
self.d_setAtticWallpaper(atticWallpaper)
def getAtticWallpaper(self):
return self.atticWallpaper.getBlob()
def setInteriorWallpaper(self, interiorWallpaper):
self.interiorWallpaper = CatalogItemList(interiorWallpaper, store=Customization)
def d_setInteriorWallpaper(self, interiorWallpaper):
self.sendUpdate('setInteriorWallpaper', [interiorWallpaper])
示例4: DistributedFurnitureManagerAI
# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import getBlob [as 别名]
class DistributedFurnitureManagerAI(DistributedObjectAI):
notify = DirectNotifyGlobal.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.avId = None
self.atticItems = None
self.atticWallpaper = None
self.wallpaper = None
self.atticWindows = None
self.windows = None
self.deletedItems = None
self.items = []
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):
items = CatalogItemList(items, store=CatalogItem.Customization | CatalogItem.Location)
for item in self.items:
item.destroy()
self.items = []
for item in items:
if item.getHashContents() in (1300, 1310, 1320, 1330, 1340, 1350):
do = DistributedBankAI(self.air, self, item)
elif 500 <= item.getHashContents() <= 518:
do = DistributedClosetAI(self.air, self, item)
do.setOwnerId(self.avId)
elif item.getHashContents() == 1399:
do = DistributedPhoneAI(self.air, self, item)
elif item.getHashContents() in (4000, 4010):
do = DistributedTrunkAI(self.air, self, item)
do.setOwnerId(self.avId)
else:
do = DistributedFurnitureItemAI(self.air, self, item)
if self.isGenerated():
do.generateWithRequired(self.zoneId)
self.items.append(do)
def getItems(self):
items = CatalogItemList(store=CatalogItem.Customization | CatalogItem.Location)
for item in self.items:
items.append(item.catalogItem)
return items.getBlob()
def setOwnerId(self, ownerId):
self.ownerId = ownerId
def d_setOwnerId(self, ownerId):
self.sendUpdate('setOwnerId', [ownerId])
def b_setOwnerId(self, ownerId):
self.setOwnerId(ownerId)
self.d_setOwnerId(ownerId)
def getOwnerId(self):
return self.ownerId
#.........这里部分代码省略.........
示例5: DistributedHouseAI
# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import getBlob [as 别名]
#.........这里部分代码省略.........
def getName(self):
return self.name
def setColor(self, color):
self.color = color
def d_setColor(self, color):
self.sendUpdate('setColor', [color])
def b_setColor(self, color):
self.setColor(color)
self.d_setColor(color)
def getColor(self):
return self.color
def setGender(self, genderIndex):
self.gender = genderIndex
def getGender(self):
return self.gender
def setAtticItems(self, atticItems):
self.atticItems = CatalogItemList(atticItems, store=Customization)
def d_setAtticItems(self, atticItems):
self.sendUpdate('setAtticItems', [atticItems])
def b_setAtticItems(self, atticItems):
self.setAtticItems(atticItems)
self.d_setAtticItems(atticItems)
def getAtticItems(self):
return self.atticItems.getBlob()
def setInteriorItems(self, interiorItems):
self.interiorItems = CatalogItemList(interiorItems, store=Customization | Location)
def d_setInteriorItems(self, interiorItems):
self.sendUpdate('setInteriorItems', [interiorItems])
def b_setInteriorItems(self, interiorItems):
self.setInteriorItems(interiorItems)
self.d_setInteriorItems(interiorItems)
def getInteriorItems(self):
return self.interiorItems.getBlob()
def setAtticWallpaper(self, atticWallpaper):
self.atticWallpaper = CatalogItemList(atticWallpaper, store=Customization)
def d_setAtticWallpaper(self, atticWallpaper):
self.sendUpdate('setAtticWallpaper', [atticWallpaper])
def b_setAtticWallpaper(self, atticWallpaper):
self.setAtticWallpaper(atticWallpaper)
self.d_setAtticWallpaper(atticWallpaper)
def getAtticWallpaper(self):
return self.atticWallpaper.getBlob()
def setInteriorWallpaper(self, interiorWallpaper):
self.interiorWallpaper = CatalogItemList(interiorWallpaper, store=Customization)
def d_setInteriorWallpaper(self, interiorWallpaper):
self.sendUpdate('setInteriorWallpaper', [interiorWallpaper])
示例6: DistributedFurnitureManagerAI
# 需要导入模块: from toontown.catalog.CatalogItemList import CatalogItemList [as 别名]
# 或者: from toontown.catalog.CatalogItemList.CatalogItemList import getBlob [as 别名]
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
#.........这里部分代码省略.........