Skip to main content

Class: ClanWarAttack

Represents a Clash of Clans War Attack.

Constructors​

constructor​

• new ClanWarAttack(clan, war, data)

Parameters​

NameType
clanWarClan
warClanWar
dataAPIClanWarAttack

Defined in​

struct/ClanWar.ts:34

Properties​

war​

• war: ClanWar

The war this attack belongs to.

Defined in​

struct/ClanWar.ts:11


clan​

• clan: WarClan

The clan this attack belongs to.

Defined in​

struct/ClanWar.ts:14


stars​

• stars: number

The stars achieved.

Defined in​

struct/ClanWar.ts:17


destruction​

• destruction: number

The destruction achieved as a percentage.

Defined in​

struct/ClanWar.ts:20


order​

• order: number

The attack order in this war.

Defined in​

struct/ClanWar.ts:23


duration​

• duration: number

Duration of attack in seconds.

Defined in​

struct/ClanWar.ts:26


attackerTag​

• attackerTag: string

The attacker tag.

Defined in​

struct/ClanWar.ts:29


defenderTag​

• defenderTag: string

The defender tag.

Defined in​

struct/ClanWar.ts:32

Accessors​

defender​

• get defender(): ClanWarMember

Returns the defending player.

Returns​

ClanWarMember

Defined in​

struct/ClanWar.ts:47


attacker​

• get attacker(): ClanWarMember

Returns the attacking player.

Returns​

ClanWarMember

Defined in​

struct/ClanWar.ts:52


isFresh​

• get isFresh(): boolean

Returns whether the attack is a fresh or first attack on the defender.

Returns​

boolean

Defined in​

struct/ClanWar.ts:57

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

Defined in​

struct/ClanWar.ts:66