C# Class ZTn.BNet.D3.Calculator.Helpers.ItemExtension

Extension class to be used with Item objects
Show file Open project: zetoken/D3-API-by-ZTn

Public Methods

Method Description
CheckAndUpdateWeaponDelta ( this item ) : Item

Check a specific case of "invalid" weapon damage values: If bonus min > delta, then delta should be replaced by bonus min + 1

GetActivatedSetBonus ( this items ) : ZTn.BNet.D3.Items.ItemAttributes

Computes the ItemAttributes brought by the set bonuses.

GetActivatedSets ( this items ) : List

Computes the list of Set actually worn.

GetArmor ( this item ) : ZTn.BNet.D3.Items.ItemValueRange

Computes armor brought by the item

GetAttributeByName ( this item, String fieldName ) : ZTn.BNet.D3.Items.ItemValueRange

Returns the value of an attribute of an item given the attribute's name

GetRawAverageBonusDamage ( this item ) : ZTn.BNet.D3.Items.ItemValueRange

Computes damages other than weapon damages (on rings, amulets, ...)

GetRawAverageWeaponDamage ( this item ) : ZTn.BNet.D3.Items.ItemValueRange

Computes weapon only damages

GetRawBonusDamageMax ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
GetRawBonusDamageMin ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
GetRawWeaponAttackPerSecond ( this item ) : ZTn.BNet.D3.Items.ItemValueRange

Computes weapon attack speed (attack per second).

GetRawWeaponDamageMax ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
GetRawWeaponDamageMin ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
GetRawWeaponDps ( this item ) : ZTn.BNet.D3.Items.ItemValueRange

Computes raw weapon dps ie before all multipliers ( = average damage * attack per second )

GetResistance ( this item, String resist ) : ZTn.BNet.D3.Items.ItemValueRange

Returns the resistance value given by the gems for the given resist

GetWeaponAttackPerSecond ( this item, ZTn.BNet.D3.Items.ItemValueRange increaseFromOtherItems ) : ZTn.BNet.D3.Items.ItemValueRange
IsAncient ( this item ) : bool

Informs if the item is ancient based on its attributes.

IsItemTypeHelm ( this item ) : System.Boolean
IsItemTypeOther ( this item ) : System.Boolean
IsItemTypeWeapon ( this item ) : System.Boolean
IsJewel ( this item ) : bool

Informs if the item is a legendary jewel based on its attributes.

IsWeapon ( this item ) : bool

Informs if the item is a weapon based on its characteristics

MergeSocketedGems ( this item ) : Item

Merge socketed gems in the item.

SetAttributeByName ( this item, String fieldName, ZTn.BNet.D3.Items.ItemValueRange value ) : Item

Sets the value of an attribute of an item given the attribute's name

Simplify ( this item ) : Item

Simplifies the item by aggregating some raw attributes (for easier editing for example).

UpdateStats ( this item ) : Item

Updates some general item stats based on its attributesRaw.

Method Details

CheckAndUpdateWeaponDelta() public static method

Check a specific case of "invalid" weapon damage values: If bonus min > delta, then delta should be replaced by bonus min + 1
public static CheckAndUpdateWeaponDelta ( this item ) : Item
item this
return Item

GetActivatedSetBonus() public static method

Computes the ItemAttributes brought by the set bonuses.
public static GetActivatedSetBonus ( this items ) : ZTn.BNet.D3.Items.ItemAttributes
items this
return ZTn.BNet.D3.Items.ItemAttributes

GetActivatedSets() public static method

Computes the list of Set actually worn.
public static GetActivatedSets ( this items ) : List
items this
return List

GetArmor() public static method

Computes armor brought by the item
public static GetArmor ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetAttributeByName() public static method

Returns the value of an attribute of an item given the attribute's name
public static GetAttributeByName ( this item, String fieldName ) : ZTn.BNet.D3.Items.ItemValueRange
item this Source item
fieldName String Name of the attribute to retrieve
return ZTn.BNet.D3.Items.ItemValueRange

GetRawAverageBonusDamage() public static method

Computes damages other than weapon damages (on rings, amulets, ...)
public static GetRawAverageBonusDamage ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawAverageWeaponDamage() public static method

Computes weapon only damages
public static GetRawAverageWeaponDamage ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawBonusDamageMax() public static method

public static GetRawBonusDamageMax ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawBonusDamageMin() public static method

public static GetRawBonusDamageMin ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawWeaponAttackPerSecond() public static method

Computes weapon attack speed (attack per second).
public static GetRawWeaponAttackPerSecond ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawWeaponDamageMax() public static method

public static GetRawWeaponDamageMax ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawWeaponDamageMin() public static method

public static GetRawWeaponDamageMin ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetRawWeaponDps() public static method

Computes raw weapon dps ie before all multipliers ( = average damage * attack per second )
public static GetRawWeaponDps ( this item ) : ZTn.BNet.D3.Items.ItemValueRange
item this
return ZTn.BNet.D3.Items.ItemValueRange

GetResistance() public static method

Returns the resistance value given by the gems for the given resist
public static GetResistance ( this item, String resist ) : ZTn.BNet.D3.Items.ItemValueRange
item this
resist String
return ZTn.BNet.D3.Items.ItemValueRange

GetWeaponAttackPerSecond() public static method

public static GetWeaponAttackPerSecond ( this item, ZTn.BNet.D3.Items.ItemValueRange increaseFromOtherItems ) : ZTn.BNet.D3.Items.ItemValueRange
item this
increaseFromOtherItems ZTn.BNet.D3.Items.ItemValueRange
return ZTn.BNet.D3.Items.ItemValueRange

IsAncient() public static method

Informs if the item is ancient based on its attributes.
public static IsAncient ( this item ) : bool
item this
return bool

IsItemTypeHelm() public static method

public static IsItemTypeHelm ( this item ) : System.Boolean
item this
return System.Boolean

IsItemTypeOther() public static method

public static IsItemTypeOther ( this item ) : System.Boolean
item this
return System.Boolean

IsItemTypeWeapon() public static method

public static IsItemTypeWeapon ( this item ) : System.Boolean
item this
return System.Boolean

IsJewel() public static method

Informs if the item is a legendary jewel based on its attributes.
public static IsJewel ( this item ) : bool
item this
return bool

IsWeapon() public static method

Informs if the item is a weapon based on its characteristics
public static IsWeapon ( this item ) : bool
item this
return bool

MergeSocketedGems() public static method

Merge socketed gems in the item.
public static MergeSocketedGems ( this item ) : Item
item this
return Item

SetAttributeByName() public static method

Sets the value of an attribute of an item given the attribute's name
public static SetAttributeByName ( this item, String fieldName, ZTn.BNet.D3.Items.ItemValueRange value ) : Item
item this Source item
fieldName String Name of the attribute to retrieve
value ZTn.BNet.D3.Items.ItemValueRange Value to set
return Item

Simplify() public static method

Simplifies the item by aggregating some raw attributes (for easier editing for example).
public static Simplify ( this item ) : Item
item this
return Item

UpdateStats() public static method

Updates some general item stats based on its attributesRaw.
public static UpdateStats ( this item ) : Item
item this
return Item