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


Python ModifiedAttributeDict.clear方法代码示例

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


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

示例1: Module

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import clear [as 别名]

#.........这里部分代码省略.........

    @property
    def chargeModifiedAttributes(self):
        return self.__chargeModifiedAttributes

    @property
    def item(self):
        return self.__item if self.__item != 0 else None

    @property
    def baseItem(self):
        return self.__baseItem

    @property
    def mutaplasmid(self):
        return self.__mutaplasmid

    @property
    def charge(self):
        return self.__charge if self.__charge != 0 else None

    @charge.setter
    def charge(self, charge):
        self.__charge = charge
        if charge is not None:
            self.chargeID = charge.ID
            self.__chargeModifiedAttributes.original = charge.attributes
            self.__chargeModifiedAttributes.overrides = charge.overrides
        else:
            self.chargeID = None
            self.__chargeModifiedAttributes.original = None
            self.__chargeModifiedAttributes.overrides = {}

        self.__itemModifiedAttributes.clear()

    @property
    def miningStats(self):
        if self.__miningyield is None:
            if self.isEmpty:
                self.__miningyield = 0
            else:
                if self.state >= FittingModuleState.ACTIVE:
                    volley = self.getModifiedItemAttr("specialtyMiningAmount") or self.getModifiedItemAttr(
                            "miningAmount") or 0
                    if volley:
                        cycleParams = self.getCycleParameters()
                        if cycleParams is None:
                            self.__miningyield = 0
                        else:
                            cycleTime = cycleParams.averageTime
                            self.__miningyield = volley / (cycleTime / 1000.0)
                    else:
                        self.__miningyield = 0
                else:
                    self.__miningyield = 0

        return self.__miningyield

    def isDealingDamage(self, ignoreState=False):
        volleyParams = self.getVolleyParameters(ignoreState=ignoreState)
        for volley in volleyParams.values():
            if volley.total > 0:
                return True
        return False

    def getVolleyParameters(self, spoolOptions=None, targetResists=None, ignoreState=False):
开发者ID:pyfa-org,项目名称:Pyfa,代码行数:70,代码来源:module.py

示例2: Module

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import clear [as 别名]

#.........这里部分代码省略.........
        return self.__itemModifiedAttributes

    @property
    def chargeModifiedAttributes(self):
        if self.__charge is None:
            self.__fetchChargeInfo()

        return self.__chargeModifiedAttributes

    @property
    def item(self):
        if self.__item is None:
            self.__fetchItemInfo()

        return self.__item if self.__item != 0 else None

    @property
    def charge(self):
        if self.__charge is None:
            self.__fetchChargeInfo()

        return self.__charge if self.__charge != 0 else None

    @charge.setter
    def charge(self, charge):
        self.__charge = charge
        if charge is not None:
            self.chargeID = charge.ID
            self.__chargeModifiedAttributes.original = charge.attributes
        else:
            self.chargeID = None
            self.__chargeModifiedAttributes.original = None

        self.__itemModifiedAttributes.clear()

    @property
    def damageStats(self):
        if self.__dps == None:
            if self.isEmpty:
                self.__dps = 0
                self.__volley = 0
            else:
                if self.state >= State.ACTIVE:
                    if self.charge:
                        volley = sum(map(lambda attr: self.getModifiedChargeAttr(attr) or 0, self.DAMAGE_ATTRIBUTES))
                    else:
                        volley = sum(map(lambda attr: self.getModifiedItemAttr(attr) or 0, self.DAMAGE_ATTRIBUTES))
                    volley *= self.getModifiedItemAttr("damageMultiplier") or 1
                    if volley:
                        cycleTime = self.cycleTime
                        self.__volley = volley
                        self.__dps = volley / (cycleTime / 1000.0)
                    else:
                        self.__volley = 0
                        self.__dps = 0
                else:
                    self.__volley = 0
                    self.__dps = 0

        return self.__dps, self.__volley

    @property
    def dps(self):
        return self.damageStats[0]

    @property
开发者ID:Dekadara,项目名称:Pyfa,代码行数:70,代码来源:module.py

示例3: Module

# 需要导入模块: from eos.modifiedAttributeDict import ModifiedAttributeDict [as 别名]
# 或者: from eos.modifiedAttributeDict.ModifiedAttributeDict import clear [as 别名]

#.........这里部分代码省略.........

    @property
    def slot(self):
        return self.__slot

    @property
    def itemModifiedAttributes(self):
        return self.__itemModifiedAttributes

    @property
    def chargeModifiedAttributes(self):
        return self.__chargeModifiedAttributes

    @property
    def item(self):
        return self.__item if self.__item != 0 else None

    @property
    def charge(self):
        return self.__charge if self.__charge != 0 else None

    @charge.setter
    def charge(self, charge):
        self.__charge = charge
        if charge is not None:
            self.chargeID = charge.ID
            self.__chargeModifiedAttributes.original = charge.attributes
            self.__chargeModifiedAttributes.overrides = charge.overrides
        else:
            self.chargeID = None
            self.__chargeModifiedAttributes.original = None
            self.__chargeModifiedAttributes.overrides = {}

        self.__itemModifiedAttributes.clear()

    def damageStats(self, targetResists):
        if self.__dps is None:
            self.__dps = 0
            self.__volley = 0

            if not self.isEmpty and self.state >= State.ACTIVE:
                if self.charge:
                    func = self.getModifiedChargeAttr
                else:
                    func = self.getModifiedItemAttr

                volley = sum(map(
                        lambda attr: (func("%sDamage" % attr) or 0) * (1 - getattr(targetResists, "%sAmount" % attr, 0)),
                        self.DAMAGE_TYPES))
                volley *= self.getModifiedItemAttr("damageMultiplier") or 1
                if volley:
                    cycleTime = self.cycleTime
                    # Some weapons repeat multiple times in one cycle (think doomsdays)
                    # Get the number of times it fires off
                    weaponDoT = max(
                            self.getModifiedItemAttr("doomsdayDamageDuration", 1) / self.getModifiedItemAttr("doomsdayDamageCycleTime", 1),
                            1
                    )

                    self.__volley = volley
                    self.__dps = (volley * weaponDoT) / (cycleTime / 1000.0)

        return self.__dps, self.__volley

    @property
    def miningStats(self):
开发者ID:copyliu,项目名称:Pyfa,代码行数:70,代码来源:module.py


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