codingame_tools.client.common.protocol.quest¶
quest
¶
JSON-serializable dataclasses for the Quest service's findQuestMap Codingame API method.
CgQuestType
module-attribute
¶
CgQuestType = str
The category of a quest, e.g. "INTRODUCTION", "ALGORITHMS", "OPTIMIZATION", "AI", "CLASH_OF_CODE", "CONTRIBUTE", "LEARNING".
CgQuestRewardType
module-attribute
¶
CgQuestRewardType = str
The kind of reward for completing a quest, e.g. "XP", "TEXT".
CgCertificationCategory
module-attribute
¶
CgCertificationCategory = str
The category of a quest certification, e.g. "ALGORITHMS", "OPTIMIZATION", "AI", "CODING_SPEED", "COLLABORATION".
CgCertificationLevel
module-attribute
¶
CgCertificationLevel = str
The tier of a quest certification, e.g. "BRONZE", "SILVER", "GOLD", "LEGEND".
CgQuestMapPoint
dataclass
¶
CgQuestMapPoint(x, y, extra_data=dict())
Bases: JSONWizardX
A single waypoint coordinate in a CgQuestMapLink's path.
CgQuestMapLink
dataclass
¶
CgQuestMapLink(from_node_id, to_node_id, path, extra_data=dict())
Bases: JSONWizardX
A directed edge between two quest map nodes, as returned (in CgQuestMap.links) by
findQuestMap.
path
instance-attribute
¶
path
Intermediate waypoints for drawing a curved/routed edge on the quest map; often empty (a straight line between the two nodes).
CgQuestReward
dataclass
¶
CgQuestReward(id, reward_type=Alias('type'), extra_data=dict(), data=None)
Bases: JSONWizardX
A single reward granted for completing a quest, as embedded in
CgQuestDetails.rewards.
reward_type
class-attribute
instance-attribute
¶
reward_type = Alias('type')
The kind of reward; see CgQuestRewardType. Determines the shape of data.
data
class-attribute
instance-attribute
¶
data = None
Reward-type-specific payload; e.g. {"xpPoints": 25} for an "XP" reward. Left as a raw
dict rather than a further-typed class pending examples of more reward types.
CgQuestCertification
dataclass
¶
CgQuestCertification(category, level, description, extra_data=dict())
Bases: JSONWizardX
A certification awarded for completing a quest, as embedded in
CgQuest.certification.
CgQuestDetails
dataclass
¶
CgQuestDetails(handle, title, description, progress_title, progress_max, rewards, extra_data=dict(), url=None)
Bases: JSONWizardX
Full details for a quest, as embedded in CgQuest.details. Not always present--e.g.
observed absent for some "CLASH_OF_CODE" quests that had neither details nor a
certification.
handle
instance-attribute
¶
handle
Opaque (but human-readable) slug for the quest, e.g. "optim-zombies".
progress_title
instance-attribute
¶
progress_title
Display text describing the completion goal, e.g. "Get a score of 40k+ points in Code vs Zombies".
progress_max
instance-attribute
¶
progress_max
The progress value that represents 100% completion; compare against
CgCodingamerQuest.progress.
url
class-attribute
instance-attribute
¶
url = None
Relative URL path to the quest's target page (e.g. a multiplayer game). Not always present--observed absent for a few quests.
CgQuest
dataclass
¶
CgQuest(id, quest_type=Alias('type'), extra_data=dict(), details=None, certification=None)
Bases: JSONWizardX
A quest definition, as embedded in CgQuestMapNode.quest. details and/or
certification may each independently be present, both present, or both absent,
depending on the quest.
quest_type
class-attribute
instance-attribute
¶
quest_type = Alias('type')
The quest's category; see CgQuestType.
details
class-attribute
instance-attribute
¶
details = None
Full quest details (title, description, progress goal, rewards). See class docstring.
certification
class-attribute
instance-attribute
¶
certification = None
The certification awarded for completing this quest, if any. See class docstring.
CgCodingamerQuest
dataclass
¶
CgCodingamerQuest(quest_id, progress, _creation_time=Alias('creationTime'), extra_data=dict(), _completion_time=Alias('completionTime', default=None), _loot_time=Alias('lootTime', default=None))
Bases: JSONWizardX
The requesting codingamer's own progress on a quest, as embedded in
CgQuestMapNode.codingamer_quest. Absent from the enclosing node entirely for quests
the codingamer has not started.
progress
instance-attribute
¶
progress
Current progress value; compare against CgQuestDetails.progress_max.
creation_time
property
writable
¶
creation_time
See the field docstring for _creation_time. Always UTC.
completion_time
property
writable
¶
completion_time
See the field docstring for _completion_time. Always UTC. None if not completed.
loot_time
property
writable
¶
loot_time
See the field docstring for _loot_time. Always UTC. None if not yet claimed.
CgQuestMapNode
dataclass
¶
CgQuestMapNode(id, x, y, quest, node_type=Alias('type'), extra_data=dict(), codingamer_quest=None)
Bases: JSONWizardX
A single node in a codingamer's quest map, as returned (in CgQuestMap.nodes) by
findQuestMap. Only node_type == "QUEST" has been observed so far.
id
instance-attribute
¶
id
Numeric ID of the node. Matches quest.id, and is referenced by CgQuestMapLink.
node_type
class-attribute
instance-attribute
¶
node_type = Alias('type')
Discriminator for the kind of node; only "QUEST" observed so far.
codingamer_quest
class-attribute
instance-attribute
¶
codingamer_quest = None
The requesting codingamer's progress on this quest. Absent if not yet started.
CgQuestMap
dataclass
¶
CgQuestMap(nodes, links, extra_data=dict())