summaryrefslogtreecommitdiff
path: root/cao-common.js
diff options
context:
space:
mode:
Diffstat (limited to 'cao-common.js')
-rw-r--r--cao-common.js9
1 files changed, 9 insertions, 0 deletions
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() {