From b8c045e0bbca22e2283aaeb7fc75cb7f19ab1303 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 9 Jun 2015 01:22:07 +0100 Subject: ui: allow to check if we are judge Signed-off-by: Olivier Gayot --- cao-common.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cao-common.js b/cao-common.js index f844762..c71036d 100644 --- a/cao-common.js +++ b/cao-common.js @@ -21,6 +21,8 @@ var CAO = function() { var request_queue = []; + var judge = false; + var self = this; var ws; @@ -33,6 +35,10 @@ var CAO = function() { var map_handle_response_ok = {}; var map_handle_notif = {}; + this.is_judge = function() { + return judge; + }; + /* map_handle_response_ok {{{ */ map_handle_response_ok['join_game'] = function(result) { @@ -55,6 +61,8 @@ var CAO = function() { }; map_handle_response_ok['pick_black_card'] = function(result) { + judge = true; + self.on_pick_black_card_ok(); map_handle_response_ok['view_black_card'](result); }; -- cgit v1.2.3