Skip to content

SimplifiedPlayer

python
class SimplifiedPlayer(BaseModel):
    id: PlayerID
    smallID: PlayerSmallID
    name: str
    type: str
    isAlive: bool
    isTraitor: bool
    alliances: List[SimplifiedAlliance]
    numTilesOwned: int
    idleTroops: float
    totalTroops: float
    maxTroops: float
    neighbors: List[Optional[PlayerID]]
    ongoingAttacks: List[SimplifiedAttack]
    incomingAttacks: List[SimplifiedAttack]
    outgoingAllianceRequests: List[SimplifiedAllianceRequest]
    incomingAllianceRequests: List[SimplifiedAllianceRequest]
java
public static class SimplifiedPlayer {
    @NotNull public PlayerID id;
    @NotNull public PlayerSmallID smallID;
    @NotNull public String name;
    @NotNull public String type;
    public boolean isAlive;
    public boolean isTraitor;
    @NotNull public List<@NotNull SimplifiedAlliance> alliances;
    public int numTilesOwned;
    public double idleTroops;
    public double attackingTroops;
    public double totalTroops;
    public double maxTroops;
    @NotNull public List<@Nullable PlayerID> neighbors;
    @NotNull public List<@NotNull SimplifiedAttack> ongoingAttacks;
    @NotNull public List<@NotNull SimplifiedAttack> incomingAttacks;
    @NotNull public List<@NotNull SimplifiedAllianceRequest> outgoingAllianceRequests;
    @NotNull public List<@NotNull SimplifiedAllianceRequest> incomingAllianceRequests;
}

Encapsulates information about a player in an ongoing game.

You can obtain the information about a player corresponding to a given PlayerID by looking in the players attribute of a SimplifiedGame instance.

Attributes

AttributeTypeDescription
idPlayerIDUnique identifier for the player.
smallIDPlayerSmallIDA smaller identifier for the player, used in certain contexts.
namestrThe player's display name (username).
typestrThe type of player (either BOT, HUMAN or FAKEHUMAN). Note that ConquerHack bots built with the scaffold will appear as HUMAN.
isAliveboolWhether the player is currently alive in the game.
isTraitorboolWhether the player has a debuff applied causing them to have weaker defenses for a certain amount of time.
alliancesList of SimplifiedAllianceA list of the player's current alliances.
numTilesOwnedintThe number of map tiles currently owned by the player.
idleTroopsfloatThe number of troops the player currently has that are not involved in attacks.
totalTroopsfloatThe total number of troops the player currently has, including those involved in attacks.
maxTroopsfloatThe maximum number of troops the player can have at once, determined by the number of tiles they own (since buildings are disabled).
neighborsList of PlayerID or None/nullA list of the player's neighboring players (i.e. those who they share a border with). If some unoccupied territory is adjacent to the player, a None/null entry will be included.
ongoingAttacksList of SimplifiedAttackA list of the player's ongoing attacks (i.e. those that have been initiated by that player but have not yet ended).
incomingAttacksList of SimplifiedAttackA list of the player's incoming attacks (i.e. those that have been initiated by other players targeting that player but have not yet ended).
outgoingAllianceRequestsList of SimplifiedAllianceRequestA list of the alliance requests that player has sent that do not yet have a response.
incomingAllianceRequestsList of SimplifiedAllianceRequestA list of the alliance requests that player has received that do not yet have a response.