Player

data class Player(val clan: PlayerClan?, val league: League?, val builderBaseLeague: SimpleLeague, val role: ClanMemberRole?, val warPreference: PlayerWarPreference?, val attackWins: Int, val defenseWins: Int, val bestVersusTrophies: Int, val townHallLevel: Int, val townHallWeaponLevel: Int, val legendStatistics: PlayerLegendStatistics?, val troops: List<PlayerItemLevel>, val heroes: List<PlayerItemLevel>, val spells: List<PlayerItemLevel>, val labels: List<Label>, val tag: String, val name: String, val expLevel: Int, val trophies: Int, val bestTrophies: Int, val donations: Int, val donationsReceived: Int, val builderHallLevel: Int, val builderBaseTrophies: Int, val bestBuilderBaseTrophies: Int, val warStars: Int, val achievements: List<PlayerAchievementsProgress>, val clanCapitalContributions: Int, val playerHouse: PlayerHouse)

Represents the Player model of the Clash of Clans API. The Player data class stores comprehensive information about a player in the game.

Constructors

Link copied to clipboard
constructor(clan: PlayerClan?, league: League?, builderBaseLeague: SimpleLeague, role: ClanMemberRole?, warPreference: PlayerWarPreference?, attackWins: Int, defenseWins: Int, bestVersusTrophies: Int, townHallLevel: Int, townHallWeaponLevel: Int, legendStatistics: PlayerLegendStatistics?, troops: List<PlayerItemLevel>, heroes: List<PlayerItemLevel>, spells: List<PlayerItemLevel>, labels: List<Label>, tag: String, name: String, expLevel: Int, trophies: Int, bestTrophies: Int, donations: Int, donationsReceived: Int, builderHallLevel: Int, builderBaseTrophies: Int, bestBuilderBaseTrophies: Int, warStars: Int, achievements: List<PlayerAchievementsProgress>, clanCapitalContributions: Int, playerHouse: PlayerHouse)

Properties

Link copied to clipboard

A list of player's achievements and their progress.

Link copied to clipboard

The total number of attack wins achieved by the player.

Link copied to clipboard

The highest number of builder base trophies earned by the player.

Link copied to clipboard

The highest number of trophies ever earned by the player.

Link copied to clipboard

The highest number of versus trophies earned by the player.

Link copied to clipboard

Information about the player's builder base league.

Link copied to clipboard

The current number of builder base trophies earned by the player.

Link copied to clipboard

The level of the player's builder hall.

Link copied to clipboard

Information about the player's clan.

Link copied to clipboard

The total number of contributions made by the player to the clan capital.

Link copied to clipboard

The total number of defense wins achieved by the player.

Link copied to clipboard

The total number of troops donated by the player.

Link copied to clipboard

The total number of troops received by the player as donations.

Link copied to clipboard

The experience level of the player.

Link copied to clipboard

A list of player's heroes and their levels.

Link copied to clipboard

A list of labels associated with the player.

Link copied to clipboard

Information about the player's league.

Link copied to clipboard

Information about the player's legend league statistics.

Link copied to clipboard

The name of the player.

Link copied to clipboard

Information about the player's house elements.

Link copied to clipboard

The role of the player in their clan (e.g., Member, Leader, etc.).

Link copied to clipboard

A list of player's spells and their levels.

Link copied to clipboard
val tag: String

The tag of the player.

Link copied to clipboard

The level of the player's town hall.

Link copied to clipboard

The level of the player's town hall weapon (if available).

Link copied to clipboard

A list of player's troops and their levels.

Link copied to clipboard

The current number of trophies earned by the player.

Link copied to clipboard

The war preference status of the player (In or Out).

Link copied to clipboard

The total number of war stars earned by the player.