From b59ef579155f41e5a1f6b8869749eff403b1fcac Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 8 Jun 2015 22:23:49 +0100 Subject: handle the notification for score update Signed-off-by: Olivier Gayot --- cao-common.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cao-common.js b/cao-common.js index c911b31..f844762 100644 --- a/cao-common.js +++ b/cao-common.js @@ -17,6 +17,7 @@ var CAO = function() { this.on_player_joined_game = function() { /* to override */ }; this.on_card_played = function() { /* to override */ }; this.on_cards_collected = function() { /* to override */ }; + this.on_updated_score = function(new_score) { }; var request_queue = []; @@ -27,6 +28,8 @@ var CAO = function() { var white_cards = {}; var black_card; + var score = 0; + var map_handle_response_ok = {}; var map_handle_notif = {}; @@ -124,6 +127,12 @@ var CAO = function() { self.on_cards_collected(); }; + map_handle_notif['updated_score'] = function(result) { + self.score = result; + + self.on_updated_score(self.score); + }; + /* }}} */ this.run = function() { -- cgit v1.2.3