public override void UpdateSeats(JSONObject jsonData)
    {
        JSONArray userList = jsonData.GetObject("gameRoom").GetArray("userGames");

        users = new JSONObject();
        for (int i = 0; i < userList.Length; i++)
        {
            users.Add(userList[i].Obj.GetInt("seatIndex").ToString(), userList[i].Obj);
        }
        // FAKE user joined
        for (int i = 0; i < 4; i++)
        {
            GameObject       tempUser;
            PlayerSlotScript playerScript = playerHolder[i];
            JSONObject       user         = users.ContainsKey(i.ToString()) ? users.GetObject(i.ToString()) : null;
            if (user != null)
            {
                playerScript.Init(user.GetString("userId"), "Dan Choi" + (i + 1), (i + 1) * 200000, string.Empty);
            }
            else
            {
                playerScript.InitEmpty();
            }
        }
    }
    public override void Init(object[] data)
    {
        base.Init(data);
        EventDelegate.Set(btnBack.onClick, BackToSelectRoom);
        EventDelegate.Set(btnThrowCard.onClick, EventPlayCards);
        Debug.Log(data[1]);
        JSONObject roomData = (JSONObject)data[1];
        JSONArray  userList = roomData.GetObject("gameRoom").GetArray("userGames");

        for (int i = 0; i < userList.Length; i++)
        {
            users.Add(userList[i].Obj.GetInt("seatIndex").ToString(), userList[i].Obj);
        }
        // FAKE user joined
        for (int i = 0; i < 4; i++)
        {
            GameObject tempUser;
            if (i < 2)
            {
                tempUser = NGUITools.AddChild(playerLeftGrid.gameObject, Resources.Load(Global.SCREEN_PATH + "/GameScreen/TienLenMN/PlayerSlot", typeof(GameObject)) as GameObject);
            }
            else
            {
                tempUser = NGUITools.AddChild(playerRightGrid.gameObject, Resources.Load(Global.SCREEN_PATH + "/GameScreen/TienLenMN/PlayerSlot", typeof(GameObject)) as GameObject);
            }
            tempUser.name = "PlayerSlot" + (i + 1);
            PlayerSlotScript playerScript = tempUser.GetComponent <PlayerSlotScript>();
            JSONObject       user         = users.ContainsKey(i.ToString()) ? users.GetObject(i.ToString()) : null;
            if (user != null)
            {
                playerScript.Init(user.GetString("userId"), "Dan Choi" + (i + 1), (i + 1) * 200000, string.Empty);
            }
            else
            {
                playerScript.InitEmpty();
            }
            playerHolder.Add(playerScript);
        }

        playerLeftGrid.Reposition();
        playerRightGrid.Reposition();

        // for (int i = 0; i < playerHolder.Count; i++) {
        //  UIButton tempBtn = playerHolder[i].btnThrowCard;
        //  tempBtn.inputParams = new object[] {playerHolder[i]};
        //       EventDelegate.Set(tempBtn.onClick, delegate() { PlayCardFromOther((PlayerSlotScript)tempBtn.inputParams[0]); });
        //       // Test Player turn circle display
        //       StartCoroutine(DisplayPlayerTurn(i));
        // }

        StartNewGame();
    }
 public void OnPlayerLeaveRoom(string roomId, string username)
 {
     if (this.roomId == roomId)
     {
         PlayerSlotScript playerSlot = FindUserSlot(username);
         if (playerSlot != null)
         {
             playerSlot.InitEmpty();
         }
         else
         {
             Debug.Log("Cant find user slot " + username);
         }
     }
     else
     {
         Debug.LogError("Not in this room " + this.roomId + " | " + roomId);
     }
 }