本文整理汇总了Python中gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE.change2Unlocked方法的典型用法代码示例。如果您正苦于以下问题:Python NODE_STATE.change2Unlocked方法的具体用法?Python NODE_STATE.change2Unlocked怎么用?Python NODE_STATE.change2Unlocked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE
的用法示例。
在下文中一共展示了NODE_STATE.change2Unlocked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _change2Unlocked
# 需要导入模块: from gui.Scaleform.daapi.view.lobby.techtree.settings import NODE_STATE [as 别名]
# 或者: from gui.Scaleform.daapi.view.lobby.techtree.settings.NODE_STATE import change2Unlocked [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
示例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 change2Unlocked [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