本文整理汇总了Python中gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE.add方法的典型用法代码示例。如果您正苦于以下问题:Python NODE_STATE.add方法的具体用法?Python NODE_STATE.add怎么用?Python NODE_STATE.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE
的用法示例。
在下文中一共展示了NODE_STATE.add方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: invalidateInstalled
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def invalidateInstalled(self):
nodes = self._getNodesToInvalidate()
rootItem = self.getRootItem()
result = []
for node in nodes:
nodeCD = node['id']
state = node['state']
item = self.getItem(nodeCD)
if rootItem.isInInventory and item.isInstalled(rootItem):
state = NODE_STATE.add(state, NODE_STATE.INSTALLED)
else:
state = NODE_STATE.remove(state, NODE_STATE.INSTALLED)
if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE and item.isElite:
state = NODE_STATE.add(state, NODE_STATE.ELITE)
if state > -1:
node['state'] = state
result.append((nodeCD, state))
return result
示例2: _change2Unlocked
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def _change2Unlocked(self, node):
state = NODE_STATE.change2Unlocked(node['state'])
if state < 0:
return node['state']
node['state'] = state
if self._canBuy(node['id']):
state = NODE_STATE.add(state, NODE_STATE.ENOUGH_MONEY)
else:
state = NODE_STATE.remove(state, NODE_STATE.ENOUGH_MONEY)
if state < 0:
return node['state']
node['state'] = state
return state
示例3: _invalidateMoney
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def _invalidateMoney(self, nodes):
result = []
for node in nodes:
state = node['state']
nodeID = node['id']
if self._canRentOrBuy(nodeID):
state = NODE_STATE.add(state, NODE_STATE.ENOUGH_MONEY)
else:
state = NODE_STATE.remove(state, NODE_STATE.ENOUGH_MONEY)
if state > -1:
node['state'] = state
result.append((nodeID, state))
return result
示例4: invalidateInstalled
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def invalidateInstalled(self):
"""
Finds items that were installed/uninstalled on root vehicle.
:return: [(<int:item compact descriptor>, <new state>), ... ].
"""
nodes = self._getNodesToInvalidate()
rootItem = self.getRootItem()
result = []
for node in nodes:
nodeCD = node['id']
state = node['state']
item = self.getItem(nodeCD)
if rootItem.isInInventory and item.isInstalled(rootItem):
state = NODE_STATE.add(state, NODE_STATE_FLAGS.INSTALLED)
else:
state = NODE_STATE.remove(state, NODE_STATE_FLAGS.INSTALLED)
if item.itemTypeID == GUI_ITEM_TYPE.VEHICLE and item.isElite:
state = NODE_STATE.add(state, NODE_STATE_FLAGS.ELITE)
if state > -1:
node['state'] = state
result.append((nodeCD, state))
return result
示例5: _invalidateXP
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def _invalidateXP(self, nodes):
result = []
stats = self.getUnlockStats()
for node in nodes:
state = node['state']
props = node['unlockProps']
if self._getAllPossibleXP(props.parentID, stats) >= props.xpCost:
state = NODE_STATE.add(state, NODE_STATE.ENOUGH_XP)
else:
state = NODE_STATE.remove(state, NODE_STATE.ENOUGH_XP)
if state > -1:
node['state'] = state
result.append((node['id'], state))
return result
示例6: _change2Unlocked
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def _change2Unlocked(self, node):
"""
Changes state of node to 'unlocked'.
:param node: node data.
:return: int containing new state of node.
"""
state = NODE_STATE.change2Unlocked(node['state'])
if state < 0:
return node['state']
node['state'] = state
if self._mayObtainForMoney(node['id']):
state = NODE_STATE.add(state, NODE_STATE_FLAGS.ENOUGH_MONEY)
else:
state = NODE_STATE.remove(state, NODE_STATE_FLAGS.ENOUGH_MONEY)
if state < 0:
return node['state']
node['state'] = state
return state
示例7: _invalidateXP
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def _invalidateXP(self, nodes):
"""
Updates states of nodes that have become available/unavailable for unlock.
:param nodes: list of nodes where search changes.
:return: list( (<node ID>, <new state>), ... ) for nodes where changed the state.
"""
result = []
stats = self.getUnlockStats()
for node in nodes:
state = node['state']
props = node['unlockProps']
if g_techTreeDP.getAllVehiclePossibleXP(props.parentID, stats) >= props.xpCost:
state = NODE_STATE.add(state, NODE_STATE_FLAGS.ENOUGH_XP)
else:
state = NODE_STATE.remove(state, NODE_STATE_FLAGS.ENOUGH_XP)
if state > -1:
node['state'] = state
result.append((node['id'], state))
return result
示例8: _invalidateMoney
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import add [as 别名]
def _invalidateMoney(self, nodes):
"""
Updates states of nodes that have become available/unavailable for purchase.
:param nodes: list of nodes where search changes.
:return: list( (<node ID>, <new state>), ... ) for nodes where changed the state.
"""
result = []
for node in nodes:
state = node['state']
nodeID = node['id']
node['GUIPrice'] = getGUIPrice(self.getItem(nodeID), self._stats.money, self._items.shop.exchangeRate)
if self._mayObtainForMoney(nodeID):
state = NODE_STATE.add(state, NODE_STATE_FLAGS.ENOUGH_MONEY)
else:
state = NODE_STATE.remove(state, NODE_STATE_FLAGS.ENOUGH_MONEY)
if state > -1:
node['state'] = state
result.append((nodeID, state))
return result