Game Objects¶
Troops, spells, heroes, pets, equipment, and parsed army-link models.
Static Unit¶
struct clashy.StaticUnit
StaticUnit contains normalized static-data fields shared by troops, spells, heroes, pets, and hero equipment.
UpgradeTime¶
time.Duration
UpgradeTime is the upgrade duration for the selected level when static data includes it.
Troop¶
struct clashy.Troop
Troop is a player troop or static troop lookup result.
MaxLevel¶
int json: maxLevel
MaxLevel is the maximum level available for the player's Town Hall or in static data.
SuperTroopIsActive¶
bool json: superTroopIsActive
SuperTroopIsActive reports whether a super troop boost is active.
StaticUnit¶
Spell¶
struct clashy.Spell
Spell is a player spell or static spell lookup result.
MaxLevel¶
int json: maxLevel
MaxLevel is the maximum level available for the player or in static data.
StaticUnit¶
Hero¶
struct clashy.Hero
Hero is a player hero or static hero lookup result.
MaxLevel¶
int json: maxLevel
MaxLevel is the maximum level available for the player or in static data.
Equipment¶
[]Equipment json: equipment
Equipment contains equipment currently assigned to this hero when the API includes loadout data.
StaticUnit¶
Pet¶
struct clashy.Pet
Pet is a hero pet from a player response or static lookup.
MaxLevel¶
int json: maxLevel
MaxLevel is the maximum level available for the player or in static data.
StaticUnit¶
Equipment¶
struct clashy.Equipment
Equipment is hero equipment from a player response or static lookup.
MaxLevel¶
int json: maxLevel
MaxLevel is the maximum level available for the player or in static data.
StaticUnit¶
Hero Loadout¶
struct clashy.HeroLoadout
HeroLoadout is one hero, pet, and equipment grouping parsed from an army link.
Army Recipe¶
struct clashy.ArmyRecipe
ArmyRecipe is the normalized representation of a Clash army link.
Troop Count¶
struct clashy.TroopCount
TroopCount pairs a troop with a quantity from an army link.
Spell Count¶
struct clashy.SpellCount
SpellCount pairs a spell with a quantity from an army link.
Account Data¶
struct clashy.AccountData
AccountData is a thin wrapper around arbitrary account-link data.
Troop Methods¶
clashy.Troop.IsBuilderBase() -> bool
IsBuilderBase reports whether the troop belongs to Builder Base.
- Return type:
-
bool
clashy.Troop.IsHomeBase() -> bool
IsHomeBase reports whether the troop belongs to the home village.
- Return type:
-
bool
clashy.Troop.IsSuperTroop() -> bool
IsSuperTroop reports whether the troop name is one of the known super troops.
- Return type:
-
bool
clashy.Troop.Static(c: *Client) -> *Troop
Static returns the embedded static-data record matching this troop's name, village, and level.
- Parameters:
-
c (
*Client)
- Return type:
-
*Troop
Spell Methods¶
clashy.Spell.Static(c: *Client) -> *Spell
Static returns the embedded static-data record matching this spell's name and level.
- Parameters:
-
c (
*Client)
- Return type:
-
*Spell
Hero Methods¶
clashy.Hero.Static(c: *Client) -> *Hero
Static returns the embedded static-data record matching this hero's name and level.
- Parameters:
-
c (
*Client)
- Return type:
-
*Hero
Pet Methods¶
clashy.Pet.Static(c: *Client) -> *Pet
Static returns the embedded static-data record matching this pet's name and level.
- Parameters:
-
c (
*Client)
- Return type:
-
*Pet
Equipment Methods¶
clashy.Equipment.Static(c: *Client) -> *Equipment
Static returns the embedded static-data record matching this equipment's name and level.
- Parameters:
-
c (
*Client)
- Return type:
-
*Equipment
Functions¶
clashy.ParseArmyRecipe(static: *StaticData, link: string) -> ArmyRecipe
ParseArmyRecipe parses a full Clash army link or raw army payload into a structured recipe using embedded static data for names and villages.
- Parameters:
-
static (
*StaticData)link (
string)
- Return type:
-
ArmyRecipe
clashy.ParseAccountData(data: map[string]any) -> AccountData
ParseAccountData wraps account-link data without mutating it.
- Parameters:
-
data (
map[string]any)
- Return type:
-
AccountData