Skip to content

Latest commit

 

History

History
50 lines (42 loc) · 2.16 KB

ranks.md

File metadata and controls

50 lines (42 loc) · 2.16 KB

Ranks (formerly Attributes)

Rank represents a variation of a particular type of reward. For e.g. badge variations in Stackoverflow, such as Gold, Silver and Bronze are ranks.

  • Ranks are associated to a game, and they must be unique within the game.
  • Ranks are identified/referenced by its id in rewards.
  • Ranks cannot be deleted once added to a game.
    • Because, players might have scored the ranks related awards already.
  • Each rank can have a color for the purpose of identification to external parties.

Example Ranking sets

  • Medal Rankings: [ Bronze, Silver, Gold, Platinum ]
  • Expertise Rankings: [ Beginner, Intermediate, Expert ]
  • Military Rankings: [ Private, Corporal, Sargent, Major ]

API Specification

EndPoint Parameters Description
POST /game/{gameId}/ranks * gameId: game id to insert this rank Allows inserting a new rank definition under a game.
GET /game/{gameId}/ranks * gameId: game id to fetch Fetch all defined ranks under a game.

Specification

Field Description Required
name A shorter name to identify this rank. yes
priority Order of ranking. This number will be sorted and assumes higher number has highest priority. yes
colorCode Hex color code to represent this ranking as a metadata. Engine does not use this at all. no

Examples

  • POST /game/{gameId}/ranks
    • Request Body:
{
   "name": "Gold",         
   "priority": 1,           // order of ranking
   "colorCode": "#FFD700"
}
  • Response Body:
{
   "id": "1",
   "name": "Gold",          
   "priority": 1,           
   "colorCode": "#FFD700"
}