Static Data Models
This section documents the static data models used for parsing game files and army links.
StaticData
- class coc.StaticData
Represents static game data loaded from game files.
This class loads and organizes all static game data from the game’s data files. It provides access to all available game items at all levels, useful for looking up item information, max levels, and statistics.
- capital_house_parts
List of all available clan capital house parts.
- Type:
List[
ClanCapitalHousePart]
- decorations
List of all available decorations.
- Type:
List[
Decoration]
- equipment
List of all available equipment.
- Type:
List[
Equipment]
AccountData
- class coc.AccountData
Represents player account data parsed from game files.
Parses raw account data from game files and creates game objects representing the player’s village state, including buildings, troops, heroes, ongoing upgrades, and active boosts. This provides a complete snapshot of a player’s account.
- townhall_level
The player’s current townhall level.
- Type:
int
- buildings
Player’s buildings as tuples of (building, quantity). Buildings can have multiple instances (e.g., multiple cannons).
- Type:
List[Tuple[
Building,int]]
- capital_house_parts
Player’s unlocked clan capital house parts.
- Type:
List[
ClanCapitalHousePart]
- decorations
Player’s decorations as tuples of (decoration, quantity).
- Type:
List[Tuple[
Decoration,int]]
- equipment
Player’s equipment with their current levels.
- Type:
List[
Equipment]
Upgrade
Boosts
- class coc.Boosts
Represents active boosts and cooldowns.
ArmyRecipe
- class coc.ArmyRecipe
Represents an army composition parsed from an army link.
- link
The army link string.
- Type:
str
- heroes_loadout
The list of hero loadouts.
- Type:
List[
HeroLoadout]
- clan_castle_troops
The list of clan castle troops with their quantities.
- Type:
List[Tuple[
Troop,int]]
- clan_castle_spells
The list of clan castle spells with their quantities.
- Type:
List[Tuple[
Spell,int]]
- _parse_items(match_str: str, base_id: int, item_class, target_list: list)
Helper to parse troops or spells from army link.