Wars¶
Classic war and Clan War League response models.
Clan War¶
struct clashy.ClanWar
ClanWar is the current, historical, or league war response.
For league wars found through GetCurrentWar or GetLeagueWar, the client orients the result so Clan is the requested clan and Opponent is the opposing side, even if the API returned the requested clan under opponent.
PreparationStartTime¶
*Timestamp json: preparationStartTime
PreparationStartTime is when preparation day began.
BattleModifier¶
string json: battleModifier
BattleModifier describes event-specific modifiers when the API includes one.
War Clan¶
struct clashy.WarClan
WarClan is one clan side of a classic war or CWL war.
Destruction¶
float64 json: destructionPercentage
Destruction is the total destruction percentage earned by this clan.
ExpEarned¶
int json: expEarned
ExpEarned is clan XP earned by this war when the endpoint includes it.
Clan War Member¶
struct clashy.ClanWarMember
ClanWarMember is a player entry on one side of a war.
OpponentAttacks¶
int json: opponentAttacks
OpponentAttacks is the number of attacks used against this base.
BestOpponentAttack¶
*WarAttack json: bestOpponentAttack
BestOpponentAttack is the best attack received by this member.
War Attack¶
struct clashy.WarAttack
WarAttack is one attack inside a classic war or Clan War League war.
Destruction¶
float64 json: destructionPercentage
Destruction is the destruction percentage earned by the attack.
Attacker¶
Attacker is optionally linked to the attacker member when a caller enriches the attack from the war member list.
Defender¶
Defender is optionally linked to the defender member when a caller enriches the attack from the war member list.
Clan War Log Entry¶
struct clashy.ClanWarLogEntry
ClanWarLogEntry is one item from a clan's public war log.
Clan War League Group¶
struct clashy.ClanWarLeagueGroup
ClanWarLeagueGroup is the current CWL group for a clan.
Rounds¶
[]struct {
WarTags []string `json:"warTags,omitempty"`
} json: rounds
Rounds contains CWL war tags grouped by round. Future rounds may contain placeholder "#0" tags.
Clan War League Clan¶
struct clashy.ClanWarLeagueClan
ClanWarLeagueClan is a clan entry inside a CWL group.
Extended CWLGroup¶
struct clashy.ExtendedCWLGroup
ExtendedCWLGroup contains static medal information for a CWL league.
FirstPlaceMedals¶
int json: first_place_medals
FirstPlaceMedals is the medal reward for first place.
SecondPlaceMedals¶
int json: second_place_medals
SecondPlaceMedals is the medal reward for second place.
War Round¶
type clashy.WarRound
WarRound identifies the logical CWL round requested from GetCurrentWar or GetLeagueWar.
int
Values¶
CurrentWar¶
CurrentWar selects the active CWL war, or the latest completed/in-war round when the latest real round is only preparation.
CurrentPreparation¶
CurrentPreparation selects the upcoming CWL preparation round when one is available.
War State¶
type clashy.WarState
WarState is the lifecycle state of a classic war or CWL war.
string
Values¶
War Result¶
type clashy.WarResult
WarResult is the requested clan's result in a war log entry.
string
Values¶
Clan War Methods¶
clashy.ClanWar.Attacks() -> []WarAttack
Attacks returns all attacks made by both sides of the war.
- Return type:
-
[]WarAttack
clashy.ClanWar.Type() -> string
Type returns "cwl" when the war has a CWL war tag and "random" otherwise.
- Return type:
-
string