Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/abrenaut/posio
/ functions
Functions
43 in github.com/abrenaut/posio
⨍
Functions
43
◇
Types & classes
17
↓ 3 callers
Function
createGeoJSONLayer
(color)
game/static/game/js/game.js:28
↓ 3 callers
Function
isQuestionInProgress
()
game/static/game/js/game.js:90
↓ 3 callers
Function
updateGeoJSONLayerFromInput
(layer, layerDataInputName)
game/static/game/js/game.js:53
↓ 2 callers
Function
isMobileViewport
()
game/static/game/js/game.js:19
↓ 2 callers
Function
updateGeoJSONLayer
(layer, layerData)
game/static/game/js/game.js:70
↓ 1 callers
Function
animatePlayerScoreValue
(playerScoreValueElement)
game/static/game/js/game.js:102
↓ 1 callers
Function
animateProgressBar
()
game/static/game/js/game.js:78
↓ 1 callers
Function
calculate_score
Calculate how close the user's answer is to the correct answer and return the distance and the score. The score is based on the distance
game/services.py:39
↓ 1 callers
Function
create_game_instance
Create a new game instance for the given game.
game/services.py:98
↓ 1 callers
Function
end_current_turn
End the current turn for the given game instance.
game/services.py:124
↓ 1 callers
Function
get_leaderboard
Return the current leaderboard with the total score for each player and the score for the question passed as an argument.
game/services.py:131
↓ 1 callers
Function
get_serialized_question_answers
Get a question's answers and serialize them so they can't be sent to websocket consumers.
game/services.py:171
↓ 1 callers
Function
main
Run administrative tasks.
manage.py:7
↓ 1 callers
Function
start_new_turn
Start a new turn for the given game instance with a new question.
game/services.py:108
Method
__str__
(self)
game/models.py:24
Method
__str__
(self)
game/models.py:35
Method
__str__
(self)
game/models.py:49
Method
__str__
(self)
game/models.py:68
Method
connect
(self)
game/consumers.py:24
Function
create_answer
Update a user answer for the current game instance question.
game/services.py:68
Function
create_player
Create a new player with the given username and session key.
game/services.py:25
Method
disconnect
(self, close_code)
game/consumers.py:38
Function
format_leaderboard
Shorten a leaderboard to only show the player's position and the top N players. Replace the player's username with "You" and highlight th
game/services.py:200
Function
game
(request, game_slug)
game/views.py:42
Method
game_answer
(self, event)
game/consumers.py:77
Function
game_loop
Main game loop that sends questions to the players and sends the updated leaderboard after each question.
game/services.py:246
Method
game_new_question
(self, event)
game/consumers.py:64
Function
get_player
Get the player for the given session key.
game/services.py:54
Method
handle
(self, *args, **options)
game/management/commands/createcitiesgame.py:12
Method
handle
(self, *args, **options)
game/management/commands/startgameloops.py:10
Method
handle
(self, *args, **options)
game/management/commands/createflagsgame.py:13
Function
index
Show the first game page with the player creation form always visible.
game/views.py:7
Function
player
(request: HttpRequest)
game/views.py:31
Method
receive
Receive message from WebSocket. The only message we expect from the client is the user's answer to the question.
game/consumers.py:41
Function
run
()
game/static/game/js/game.js:110
Method
setUp
(self)
game/tests/test_services/test_get_leaderboard.py:9
Method
setUp
(self)
game/tests/test_services/test_create_answer.py:12
Method
setUp
(self)
game/tests/test_services/test_calculate_score.py:9
Method
test_create_answer
(self)
game/tests/test_services/test_create_answer.py:28
Method
test_create_answer_after_turn_finished
(self)
game/tests/test_services/test_create_answer.py:69
Method
test_end_current_turn
(self)
game/tests/test_services/test_get_leaderboard.py:41
Method
test_score_for_city_question
(self)
game/tests/test_services/test_format_leaderboard_for_user.py:11
Method
test_score_for_city_question
(self)
game/tests/test_services/test_calculate_score.py:12