C# Класс Ensage.Common.Extensions.UnitExtensions

The unit extensions.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AghanimState ( this unit ) : bool

Checks if given hero has AghanimScepter

AttackBackswing ( this unit ) : double

The attack backswing.

AttackPoint ( this unit ) : double

The attack point.

AttackRate ( this unit ) : double

The attack rate.

BasePredict ( this unit, Unit source, float delay, float speed ) : System.Vector3

The base predict.

BasePredict ( this unit, float delay ) : System.Vector3

The base predict.

BestAATarget ( this unit, float bonusRange ) : Hero

The best aa target.

CanAttack ( this unit ) : bool

Checks if given unit is able to attack

CanCast ( this unit ) : bool

Checks if given unit is able to cast spells

CanDie ( this unit, string sourceAbilityName = null, bool ignoreReincarnation = false ) : bool

The can die.

CanMove ( this unit ) : bool

Checks if given unit is able to move

CanReincarnate ( this unit ) : bool

The can reincarnate.

CanUseItems ( this unit ) : bool

Checks if given unit is not muted

ClosestToMouseTarget ( this source, float range = 1000 ) : Hero

The closest to mouse target.

DamageTaken ( this target, float dmg, DamageType dmgType, Unit source, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

Returns actual damage the unit takes

DisableTarget ( this unit, Unit target ) : bool

Uses available disable ability which takes least time to hit the target, chains with other disables

FindItem ( this unit, string name, System.Item &item, bool cache = false ) : System.Item

The find item.

FindItem ( this unit, string name, bool cache = false ) : System.Item

Searches for a item in the units inventory with given name

FindModifier ( this unit, string modifierName ) : Modifier

The has modifier.

FindRelativeAngle ( this unit, System.Vector3 pos ) : float

The find relative angle.

FindRelativeAngle ( this unit, System.Vector3 pos, float delta ) : float

The find relative angle.

FindSpell ( this unit, string name, Ability &spell ) : Ability

The find spell.

FindSpell ( this unit, string name, bool cache = false ) : Ability

Returns spell of the unit with given name if it exists

GetAttackRange ( this unit ) : float

Returns actual attack range of a unit

GetChanneledAbility ( this unit ) : Ability

Finds spell/item which is currently being channeled by given unit

GetDagon ( this unit ) : System.Item

Finds a dagon in the units inventory

GetEnemyTeam ( this unit ) : Team

Returns Enemy Team of the unit

GetLeveledItem ( this unit, string name ) : System.Item

Finds item with given name which has more than 1 level

GetTurnRate ( this unit, bool currentTurnRate = true ) : double

The get turn rate.

GetTurnTime ( this unit, System.Entity entity ) : double

Calculates how much time it will take for given unit to turn to another entity

GetTurnTime ( this unit, System.Vector3 position ) : double

Calculates how much time it will take for given unit to turn to given vector

HasItem ( this unit, ClassID classId ) : bool

Returns if the target has the given Item

HasModifier ( this unit, string modifierName ) : bool

The has modifier.

HasModifiers ( this unit, string modifierNames, bool hasAll = true ) : bool

The has modifiers.

InFront ( this unit, float distance ) : System.Vector3

The in front.

IsAttackImmune ( this unit ) : bool

Checks if unit is immune to auto attack

IsAttacking ( this unit ) : bool

The is attacking.

IsChanneling ( this unit ) : bool

Checks if unit is currently channeling

IsDisarmed ( this unit ) : bool

The is disarmed.

IsHexed ( this unit ) : bool

The is hexed.

IsHexed ( this unit, float &hexDuration ) : bool

The is hexed.

IsInvisible ( this unit ) : bool

The is invisible.

IsInvul ( this unit ) : bool

The is invulnerable.

IsInvul ( this unit, float &invulnerabilityDuration ) : bool

The is invulnerable.

IsLinkensProtected ( this unit ) : bool

The is linken protected.

IsMagicImmune ( this unit ) : bool

The is magic immune.

IsPurgable ( this unit ) : bool

Checks if enemy have a modifier which can be purged

IsRooted ( this unit ) : bool

The is rooted.

IsRooted ( this unit, float &rootDuration ) : bool

The is rooted.

IsSilenced ( this unit ) : bool

The is silenced.

IsStunned ( this unit ) : bool

The is stunned.

IsStunned ( this unit, float &stunDuration ) : bool

The is stunned.

IsUnitState ( this unit, UnitState state ) : bool

The is unit state.

IsValidTarget ( this unit, float range = float.MaxValue, bool checkTeam = true, System.Vector3 from = newVector3() ) : bool

The is valid target.

ManaBurnDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

Returns how much mana burn damage given unit receives

ManaBurnSpellDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, string spellName, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

The mana burn spell damage taken.

Predict ( this unit, float delay ) : System.Vector3

Returns predicted location of a unit after given milliseconds

ProjectileSpeed ( this unit ) : double

The projectile speed.

SilenceTarget ( this unit, Unit target ) : bool

Uses available silence ability which takes least time to hit the target, chains with disables

SlowTarget ( this unit, Unit target ) : bool

Uses available slow ability which takes least time to hit the target, chains with other disables

SpellDamageTaken ( this target, float dmg, DamageType dmgType, Unit source, string spellName, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float

The spell damage taken.

Vector2FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector2

The vector 2 from polar angle.

Vector3FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector3

The vector 3 from polar angle.

Приватные методы

Метод Описание
Init ( ) : void

The initialize.

Описание методов

AghanimState() публичный статический Метод

Checks if given hero has AghanimScepter
public static AghanimState ( this unit ) : bool
unit this /// The unit. ///
Результат bool

AttackBackswing() публичный статический Метод

The attack backswing.
public static AttackBackswing ( this unit ) : double
unit this /// The unit. ///
Результат double

AttackPoint() публичный статический Метод

The attack point.
public static AttackPoint ( this unit ) : double
unit this /// The unit. ///
Результат double

AttackRate() публичный статический Метод

The attack rate.
public static AttackRate ( this unit ) : double
unit this /// The unit. ///
Результат double

BasePredict() публичный статический Метод

The base predict.
public static BasePredict ( this unit, Unit source, float delay, float speed ) : System.Vector3
unit this /// The unit. ///
source Unit /// The source. ///
delay float /// The delay in milliseconds. ///
speed float /// The speed. ///
Результат System.Vector3

BasePredict() публичный статический Метод

The base predict.
public static BasePredict ( this unit, float delay ) : System.Vector3
unit this /// The unit. ///
delay float /// The delay in milliseconds. ///
Результат System.Vector3

BestAATarget() публичный статический Метод

The best aa target.
public static BestAATarget ( this unit, float bonusRange ) : Hero
unit this /// The unit. ///
bonusRange float /// The bonus range. ///
Результат Hero

CanAttack() публичный статический Метод

Checks if given unit is able to attack
public static CanAttack ( this unit ) : bool
unit this /// The unit. ///
Результат bool

CanCast() публичный статический Метод

Checks if given unit is able to cast spells
public static CanCast ( this unit ) : bool
unit this /// The unit. ///
Результат bool

CanDie() публичный статический Метод

The can die.
public static CanDie ( this unit, string sourceAbilityName = null, bool ignoreReincarnation = false ) : bool
unit this /// The unit. ///
sourceAbilityName string /// The source ability name. ///
ignoreReincarnation bool /// The ignore reincarnation. ///
Результат bool

CanMove() публичный статический Метод

Checks if given unit is able to move
public static CanMove ( this unit ) : bool
unit this /// The unit. ///
Результат bool

CanReincarnate() публичный статический Метод

The can reincarnate.
public static CanReincarnate ( this unit ) : bool
unit this /// The unit. ///
Результат bool

CanUseItems() публичный статический Метод

Checks if given unit is not muted
public static CanUseItems ( this unit ) : bool
unit this /// The unit. ///
Результат bool

ClosestToMouseTarget() публичный статический Метод

The closest to mouse target.
public static ClosestToMouseTarget ( this source, float range = 1000 ) : Hero
source this /// The source. ///
range float /// The range. ///
Результат Hero

DamageTaken() публичный статический Метод

Returns actual damage the unit takes
public static DamageTaken ( this target, float dmg, DamageType dmgType, Unit source, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
target this /// damaged unit ///
dmg float /// amount of damage ///
dmgType DamageType /// Type of damage (Magical/Physical/Pure/Health removal) ///
source Unit /// source of the damage ///
throughBKB bool /// true if the damage pierces magic immunity ///
minusArmor double /// The minus Armor. ///
minusDamageResistancePerc double /// The minus Damage Resistance Percentage. ///
minusMagicResistancePerc double /// The minus Magic Resistance Percentage. ///
Результат float

DisableTarget() публичный статический Метод

Uses available disable ability which takes least time to hit the target, chains with other disables
public static DisableTarget ( this unit, Unit target ) : bool
unit this /// The unit. ///
target Unit /// The target. ///
Результат bool

FindItem() публичный статический Метод

The find item.
public static FindItem ( this unit, string name, System.Item &item, bool cache = false ) : System.Item
unit this /// The unit. ///
name string /// The name. ///
item System.Item /// The item. ///
cache bool /// The cache. ///
Результат System.Item

FindItem() публичный статический Метод

Searches for a item in the units inventory with given name
public static FindItem ( this unit, string name, bool cache = false ) : System.Item
unit this /// The unit. ///
name string /// The name. ///
cache bool /// Store the item and use stored next time (Risk of EntityNotFoundException) ///
Результат System.Item

FindModifier() публичный статический Метод

The has modifier.
public static FindModifier ( this unit, string modifierName ) : Modifier
unit this /// The unit. ///
modifierName string /// The modifier name. ///
Результат Modifier

FindRelativeAngle() публичный статический Метод

The find relative angle.
public static FindRelativeAngle ( this unit, System.Vector3 pos ) : float
unit this /// The unit. ///
pos System.Vector3 /// The position. ///
Результат float

FindRelativeAngle() публичный статический Метод

The find relative angle.
public static FindRelativeAngle ( this unit, System.Vector3 pos, float delta ) : float
unit this /// The unit. ///
pos System.Vector3 /// The pos. ///
delta float /// The alpha. ///
Результат float

FindSpell() публичный статический Метод

The find spell.
public static FindSpell ( this unit, string name, Ability &spell ) : Ability
unit this /// The unit. ///
name string /// The name. ///
spell Ability /// The spell. ///
Результат Ability

FindSpell() публичный статический Метод

Returns spell of the unit with given name if it exists
public static FindSpell ( this unit, string name, bool cache = false ) : Ability
unit this /// The unit. ///
name string /// The name. ///
cache bool /// Use cached spell (risk of EntityNotFoundException) ///
Результат Ability

GetAttackRange() публичный статический Метод

Returns actual attack range of a unit
public static GetAttackRange ( this unit ) : float
unit this /// The unit. ///
Результат float

GetChanneledAbility() публичный статический Метод

Finds spell/item which is currently being channeled by given unit
public static GetChanneledAbility ( this unit ) : Ability
unit this /// The unit. ///
Результат Ability

GetDagon() публичный статический Метод

Finds a dagon in the units inventory
public static GetDagon ( this unit ) : System.Item
unit this /// The unit. ///
Результат System.Item

GetEnemyTeam() публичный статический Метод

Returns Enemy Team of the unit
public static GetEnemyTeam ( this unit ) : Team
unit this /// The unit. ///
Результат Team

GetLeveledItem() публичный статический Метод

Finds item with given name which has more than 1 level
public static GetLeveledItem ( this unit, string name ) : System.Item
unit this /// The unit. ///
name string /// The name. ///
Результат System.Item

GetTurnRate() публичный статический Метод

The get turn rate.
public static GetTurnRate ( this unit, bool currentTurnRate = true ) : double
unit this /// The unit. ///
currentTurnRate bool /// The current turn rate. ///
Результат double

GetTurnTime() публичный статический Метод

Calculates how much time it will take for given unit to turn to another entity
public static GetTurnTime ( this unit, System.Entity entity ) : double
unit this /// The unit. ///
entity System.Entity /// The unit 2. ///
Результат double

GetTurnTime() публичный статический Метод

Calculates how much time it will take for given unit to turn to given vector
public static GetTurnTime ( this unit, System.Vector3 position ) : double
unit this /// The entity. ///
position System.Vector3 /// The position. ///
Результат double

HasItem() публичный статический Метод

Returns if the target has the given Item
public static HasItem ( this unit, ClassID classId ) : bool
unit this /// The unit. ///
classId ClassID /// The class Id. ///
Результат bool

HasModifier() публичный статический Метод

The has modifier.
public static HasModifier ( this unit, string modifierName ) : bool
unit this /// The unit. ///
modifierName string /// The modifier name. ///
Результат bool

HasModifiers() публичный статический Метод

The has modifiers.
public static HasModifiers ( this unit, string modifierNames, bool hasAll = true ) : bool
unit this /// The unit. ///
modifierNames string /// The modifier names. ///
hasAll bool /// The has all. ///
Результат bool

InFront() публичный статический Метод

The in front.
public static InFront ( this unit, float distance ) : System.Vector3
unit this /// The unit. ///
distance float /// The distance. ///
Результат System.Vector3

IsAttackImmune() публичный статический Метод

Checks if unit is immune to auto attack
public static IsAttackImmune ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsAttacking() публичный статический Метод

The is attacking.
public static IsAttacking ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsChanneling() публичный статический Метод

Checks if unit is currently channeling
public static IsChanneling ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsDisarmed() публичный статический Метод

The is disarmed.
public static IsDisarmed ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsHexed() публичный статический Метод

The is hexed.
public static IsHexed ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsHexed() публичный статический Метод

The is hexed.
public static IsHexed ( this unit, float &hexDuration ) : bool
unit this /// The unit. ///
hexDuration float /// The hex duration. ///
Результат bool

IsInvisible() публичный статический Метод

The is invisible.
public static IsInvisible ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsInvul() публичный статический Метод

The is invulnerable.
public static IsInvul ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsInvul() публичный статический Метод

The is invulnerable.
public static IsInvul ( this unit, float &invulnerabilityDuration ) : bool
unit this /// The unit. ///
invulnerabilityDuration float /// The invulnerability duration. ///
Результат bool

IsLinkensProtected() публичный статический Метод

The is linken protected.
public static IsLinkensProtected ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsMagicImmune() публичный статический Метод

The is magic immune.
public static IsMagicImmune ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsPurgable() публичный статический Метод

Checks if enemy have a modifier which can be purged
public static IsPurgable ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsRooted() публичный статический Метод

The is rooted.
public static IsRooted ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsRooted() публичный статический Метод

The is rooted.
public static IsRooted ( this unit, float &rootDuration ) : bool
unit this /// The unit. ///
rootDuration float /// The root duration. ///
Результат bool

IsSilenced() публичный статический Метод

The is silenced.
public static IsSilenced ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsStunned() публичный статический Метод

The is stunned.
public static IsStunned ( this unit ) : bool
unit this /// The unit. ///
Результат bool

IsStunned() публичный статический Метод

The is stunned.
public static IsStunned ( this unit, float &stunDuration ) : bool
unit this /// The unit. ///
stunDuration float /// The stun duration. ///
Результат bool

IsUnitState() публичный статический Метод

The is unit state.
public static IsUnitState ( this unit, UnitState state ) : bool
unit this /// The unit. ///
state UnitState /// The state. ///
Результат bool

IsValidTarget() публичный статический Метод

The is valid target.
public static IsValidTarget ( this unit, float range = float.MaxValue, bool checkTeam = true, System.Vector3 from = newVector3() ) : bool
unit this /// The unit. ///
range float /// The range. ///
checkTeam bool /// The check team. ///
from System.Vector3 /// The from. ///
Результат bool

ManaBurnDamageTaken() публичный статический Метод

Returns how much mana burn damage given unit receives
public static ManaBurnDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
unit this /// The unit. ///
burnAmount float /// The burn Amount. ///
multiplier double /// The multiplier. ///
dmgType DamageType /// The dmg Type. ///
source Unit /// The source. ///
throughBkb bool /// The through Bkb. ///
minusArmor double /// The minus Armor. ///
minusDamageResistancePerc double /// The minus Damage Resistance Perc. ///
minusMagicResistancePerc double /// The minus Magic Resistance Perc. ///
Результат float

ManaBurnSpellDamageTaken() публичный статический Метод

The mana burn spell damage taken.
public static ManaBurnSpellDamageTaken ( this unit, float burnAmount, double multiplier, DamageType dmgType, Unit source, string spellName, bool throughBkb = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
unit this /// The unit. ///
burnAmount float /// The burn amount. ///
multiplier double /// The multiplier. ///
dmgType DamageType /// The dmg type. ///
source Unit /// The source. ///
spellName string /// The spell name. ///
throughBkb bool /// The through bkb. ///
minusArmor double /// The minus armor. ///
minusDamageResistancePerc double /// The minus damage resistance perc. ///
minusMagicResistancePerc double /// The minus magic resistance perc. ///
Результат float

Predict() публичный статический Метод

Returns predicted location of a unit after given milliseconds
public static Predict ( this unit, float delay ) : System.Vector3
unit this /// The unit. ///
delay float /// The delay. ///
Результат System.Vector3

ProjectileSpeed() публичный статический Метод

The projectile speed.
public static ProjectileSpeed ( this unit ) : double
unit this /// The unit. ///
Результат double

SilenceTarget() публичный статический Метод

Uses available silence ability which takes least time to hit the target, chains with disables
public static SilenceTarget ( this unit, Unit target ) : bool
unit this /// The unit. ///
target Unit /// The target. ///
Результат bool

SlowTarget() публичный статический Метод

Uses available slow ability which takes least time to hit the target, chains with other disables
public static SlowTarget ( this unit, Unit target ) : bool
unit this /// The unit. ///
target Unit /// The target. ///
Результат bool

SpellDamageTaken() публичный статический Метод

The spell damage taken.
public static SpellDamageTaken ( this target, float dmg, DamageType dmgType, Unit source, string spellName, bool throughBKB = false, double minusArmor = 0d, double minusDamageResistancePerc = 0d, double minusMagicResistancePerc = 0d ) : float
target this /// The target. ///
dmg float /// The dmg. ///
dmgType DamageType /// The dmg type. ///
source Unit /// The source. ///
spellName string /// The spell name. ///
throughBKB bool /// The through bkb. ///
minusArmor double /// The minus armor. ///
minusDamageResistancePerc double /// The minus damage resistance perc. ///
minusMagicResistancePerc double /// The minus magic resistance perc. ///
Результат float

Vector2FromPolarAngle() публичный статический Метод

The vector 2 from polar angle.
public static Vector2FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector2
unit this /// The unit. ///
delta float /// The delta. ///
radial float /// The radial. ///
Результат System.Vector2

Vector3FromPolarAngle() публичный статический Метод

The vector 3 from polar angle.
public static Vector3FromPolarAngle ( this unit, float delta = 0f, float radial = 1f ) : System.Vector3
unit this /// The unit. ///
delta float /// The delta. ///
radial float /// The radial. ///
Результат System.Vector3