Class: ClanWarAttack
Represents a Clash of Clans War Attack.
Constructors
constructor
• new ClanWarAttack(clan, war, data)
Parameters
| Name | Type |
|---|---|
clan | WarClan |
war | ClanWar |
data | APIClanWarAttack |
Defined in
Properties
war
• war: ClanWar
The war this attack belongs to.
Defined in
clan
• clan: WarClan
The clan this attack belongs to.
Defined in
stars
• stars: number
The stars achieved.
Defined in
destruction
• destruction: number
The destruction achieved as a percentage.
Defined in
order
• order: number
The attack order in this war.
Defined in
duration
• duration: number
Duration of attack in seconds.
Defined in
attackerTag
• attackerTag: string
The attacker tag.
Defined in
defenderTag
• defenderTag: string
The defender tag.
Defined in
Accessors
defender
• get defender(): ClanWarMember
Returns the defending player.
Returns
Defined in
attacker
• get attacker(): ClanWarMember
Returns the attacking player.
Returns
Defined in
isFresh
• get isFresh(): boolean
Returns whether the attack is a fresh or first attack on the defender.
Returns
boolean
Defined in
Methods
previousBestAttack
▸ previousBestAttack(): null | ClanWarAttack
Returns the previous best attack on this opponent village. This is useful for calculating the new stars or destruction for new attacks.
Returns
null | ClanWarAttack