本文整理汇总了Python中eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python AttrCalcTestCase.setUp方法的具体用法?Python AttrCalcTestCase.setUp怎么用?Python AttrCalcTestCase.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase
的用法示例。
在下文中一共展示了AttrCalcTestCase.setUp方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1)
srcAttr = self.ch.attribute(attributeId=2)
modifier = Modifier()
modifier.state = State.offline
modifier.context = Context.local
modifier.sourceAttributeId = srcAttr.id
modifier.operator = Operator.postPercent
modifier.targetAttributeId = self.tgtAttr.id
modifier.location = Location.ship
modifier.filterType = FilterType.all_
modifier.filterValue = None
effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
effect.modifiers = (modifier,)
self.influenceSource1 = IndependentItem(self.ch.type_(typeId=1, effects=(effect,), attributes={srcAttr.id: 20}))
self.influenceSource2 = IndependentItem(self.ch.type_(typeId=2, effects=(effect,), attributes={srcAttr.id: 50}))
self.influenceSource3 = IndependentItem(self.ch.type_(typeId=3, effects=(effect,), attributes={srcAttr.id: -90}))
self.influenceSource4 = IndependentItem(self.ch.type_(typeId=4, effects=(effect,), attributes={srcAttr.id: -25}))
self.influenceSource5 = IndependentItem(self.ch.type_(typeId=5, effects=(effect,), attributes={srcAttr.id: 400}))
self.influenceTarget = ShipItem(self.ch.type_(typeId=6, attributes={self.tgtAttr.id: 100}))
self.fit.items.add(self.influenceSource1)
self.fit.items.add(self.influenceSource2)
self.fit.items.add(self.influenceSource3)
self.fit.items.add(self.influenceSource4)
self.fit.items.add(self.influenceSource5)
self.fit.items.add(self.influenceTarget)
示例2: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1, stackable=1)
srcAttr1 = self.ch.attribute(attributeId=2)
srcAttr2 = self.ch.attribute(attributeId=3)
srcAttr3 = self.ch.attribute(attributeId=4)
srcAttr4 = self.ch.attribute(attributeId=5)
modifierOff = Modifier()
modifierOff.state = State.offline
modifierOff.context = Context.local
modifierOff.sourceAttributeId = srcAttr1.id
modifierOff.operator = Operator.postMul
modifierOff.targetAttributeId = self.tgtAttr.id
modifierOff.location = Location.self_
modifierOff.filterType = None
modifierOff.filterValue = None
modifierOn = Modifier()
modifierOn.state = State.online
modifierOn.context = Context.local
modifierOn.sourceAttributeId = srcAttr2.id
modifierOn.operator = Operator.postMul
modifierOn.targetAttributeId = self.tgtAttr.id
modifierOn.location = Location.self_
modifierOn.filterType = None
modifierOn.filterValue = None
modifierAct = Modifier()
modifierAct.state = State.active
modifierAct.context = Context.local
modifierAct.sourceAttributeId = srcAttr3.id
modifierAct.operator = Operator.postMul
modifierAct.targetAttributeId = self.tgtAttr.id
modifierAct.location = Location.self_
modifierAct.filterType = None
modifierAct.filterValue = None
modifierOver = Modifier()
modifierOver.state = State.overload
modifierOver.context = Context.local
modifierOver.sourceAttributeId = srcAttr4.id
modifierOver.operator = Operator.postMul
modifierOver.targetAttributeId = self.tgtAttr.id
modifierOver.location = Location.self_
modifierOver.filterType = None
modifierOver.filterValue = None
# Overload category will make sure that holder can enter all states
effect = self.ch.effect(effectId=1, categoryId=EffectCategory.overload)
effect.modifiers = (modifierOff, modifierOn, modifierAct, modifierOver)
self.holder = IndependentItem(
self.ch.type_(
typeId=1,
effects=(effect,),
attributes={
self.tgtAttr.id: 100,
srcAttr1.id: 1.1,
srcAttr2.id: 1.3,
srcAttr3.id: 1.5,
srcAttr4.id: 1.7,
},
)
)
示例3: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.attr1 = self.ch.attribute(attributeId=1)
self.attr2 = self.ch.attribute(attributeId=2)
self.attr3 = self.ch.attribute(attributeId=3)
self.holder = IndependentItem(self.ch.type_(typeId=1, attributes={self.attr1.id: 5, self.attr2.id: 10}))
self.fit.items.add(self.holder)
self.holder.attributes._MutableAttributeMap__modifiedAttributes = {self.attr2.id: 20, self.attr3.id: 40}
示例4: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1)
self.srcAttr = self.ch.attribute(attributeId=2)
self.invalidModifier = invalidModifier = Modifier()
invalidModifier.state = State.offline
invalidModifier.context = Context.local
invalidModifier.sourceAttributeId = self.srcAttr.id
invalidModifier.operator = Operator.postPercent
invalidModifier.targetAttributeId = self.tgtAttr.id
invalidModifier.location = 1972
invalidModifier.filterType = FilterType.all_
invalidModifier.filterValue = None
self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
示例5: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1, stackable=0)
self.srcAttr = self.ch.attribute(attributeId=2)
modifier = Modifier()
modifier.state = State.offline
modifier.context = Context.local
modifier.sourceAttributeId = self.srcAttr.id
modifier.operator = Operator.postPercent
modifier.targetAttributeId = self.tgtAttr.id
modifier.location = Location.ship
modifier.filterType = FilterType.all_
modifier.filterValue = None
self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
self.effect.modifiers = (modifier,)
示例6: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1)
srcAttr = self.ch.attribute(attributeId=2)
modifier = Modifier()
modifier.state = State.offline
modifier.context = Context.local
modifier.sourceAttributeId = srcAttr.id
modifier.operator = Operator.postPercent
modifier.targetAttributeId = self.tgtAttr.id
modifier.location = Location.self_
modifier.filterType = FilterType.all_
modifier.filterValue = None
effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
effect.modifiers = (modifier,)
self.influenceSource = IndependentItem(self.ch.type_(typeId=1061, effects=(effect,), attributes={srcAttr.id: 20}))
示例7: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.cappedAttr = self.ch.attribute(attributeId=1, maxAttributeId=2)
self.cappingAttr = self.ch.attribute(attributeId=2, defaultValue=5)
self.sourceAttr = self.ch.attribute(attributeId=3)
# Just to make sure cap is applied to final value, not
# base, make some basic modification modifier
modifier = Modifier()
modifier.state = State.offline
modifier.context = Context.local
modifier.sourceAttributeId = self.sourceAttr.id
modifier.operator = Operator.postMul
modifier.targetAttributeId = self.cappedAttr.id
modifier.location = Location.self_
modifier.filterType = None
modifier.filterValue = None
self.effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
self.effect.modifiers = (modifier,)
示例8: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1)
srcAttr = self.ch.attribute(attributeId=2)
modifier = Modifier()
modifier.state = State.offline
modifier.context = Context.local
modifier.sourceAttributeId = srcAttr.id
modifier.operator = Operator.postPercent
modifier.targetAttributeId = self.tgtAttr.id
modifier.location = Location.character
modifier.filterType = FilterType.all_
modifier.filterValue = None
effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
effect.modifiers = (modifier,)
# It doesn't matter holder of which type we're using,
# the only thing which matters is its position in fit
self.influenceSource = IndependentItem(self.ch.type_(typeId=1, effects=(effect,), attributes={srcAttr.id: 20}))
self.fit.items.add(self.influenceSource)
示例9: setUp
# 需要导入模块: from eos.tests.attributeCalculator.attrCalcTestCase import AttrCalcTestCase [as 别名]
# 或者: from eos.tests.attributeCalculator.attrCalcTestCase.AttrCalcTestCase import setUp [as 别名]
def setUp(self):
AttrCalcTestCase.setUp(self)
self.tgtAttr = self.ch.attribute(attributeId=1)
srcAttr = self.ch.attribute(attributeId=2)
modifier = Modifier()
modifier.state = State.offline
modifier.context = Context.local
modifier.sourceAttributeId = srcAttr.id
modifier.operator = Operator.postPercent
modifier.targetAttributeId = self.tgtAttr.id
modifier.location = Location.other
modifier.filterType = None
modifier.filterValue = None
effect = self.ch.effect(effectId=1, categoryId=EffectCategory.passive)
effect.modifiers = (modifier,)
# We added target attribute to influence source for testSelf;
# currently, eos cannot calculate attributes which are originally
# missing on item
self.influenceSource = ItemWithOther(self.ch.type_(typeId=1, effects=(effect,), attributes={self.tgtAttr.id: 100, srcAttr.id: 20}))
self.fit.items.add(self.influenceSource)