Example #1
0
    private void onCreateCallback(DataLobby obj)
    {
        bool canAdded = false;

        if (!IsFiltered)
        {
            if (Lobbies != null && Lobbies.Find(item => item.roomId == obj.roomId) == null)
            {
                canAdded = true;
            }
        }
        else
        {
            List <DataLobby> listLobbyFilter = getListLobbyFilter();
            if (listLobbyFilter.Contains(obj))
            {
                canAdded = true;
            }
        }
        if (canAdded)
        {
            view.AddLobby(obj);
            Lobbies.Add(obj);
        }
    }
Example #2
0
    private IEnumerator _AddRowType2(DataLobby lobby)
    {
        yield return(new WaitForEndOfFrame());

        types2.Add(LobbyRowType2.Create(lobby, tableType2));
        tableType2.repositionNow = true;
    }
Example #3
0
    public void setData(DataLobby lobby)
    {
        for (int i = 0; i < slots.Length; i++)
        {
            slots[i].SetActive(false);
        }

        this.data = lobby;
        double smallBind = lobby.gameDetails.betting / 2;

        title.text = "Phòng : " + lobby.roomId + " - $" + smallBind + "/" + lobby.gameDetails.betting;

        if (data.users != null && data.users.Length > 0)
        {
            foreach (DataPlayerController item in data.users)
            {
                int index = item.slotIndex;
                if (data.gameDetails.numPlayers == 5)
                {
                    index = arrayIndex5Player[item.slotIndex];
                }

                slots[index].SetActive(true);
                slots[index].GetComponent <LobbySlot>().setData(item);
            }
        }
    }
Example #4
0
    private void onUpdateCallback(DataLobby obj)
    {
        view.UpdateLobby(obj);
        DataLobby lob = Lobbies.Find(i => i.roomId == obj.roomId);

        lob = obj;
    }
Example #5
0
    private void _UpdateLobbyType2(DataLobby lobby)
    {
        LobbyRowType2 lobbyRow = types2.Find(lb => lb.data.roomId == lobby.roomId);

        if (lobbyRow != null)
        {
            lobbyRow.setData(lobby);
        }
    }
Example #6
0
 public static LobbyRowType2 Create(DataLobby data, UITable parent)
 {
     GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType2")) as GameObject;
     go.transform.parent = parent.transform;
     go.transform.localPosition = Vector3.zero;
     go.transform.localScale = Vector3.one;
     go.name = data.roomId + " - " + data.roomName;
     LobbyRowType2 item = go.GetComponent<LobbyRowType2>();
     item.StartCoroutine(item.setData(data));
     return item;
 }
Example #7
0
 private void _UpdateLobby(DataLobby lobby)
 {
     if (isShowType1)
     {
         _UpdateLobbyType1(lobby);
     }
     else
     {
         _UpdateLobbyType2(lobby);
     }
 }
Example #8
0
 public void AddLobby(DataLobby lobby)
 {
     if (isShowType1)
     {
         StartCoroutine(_AddRowType1(lobby));
     }
     else
     {
         StartCoroutine(_AddRowType2(lobby));
     }
 }
Example #9
0
    private IEnumerator _AddRowType1(DataLobby lobby)
    {
        yield return(new WaitForEndOfFrame());

        types1.Add(LobbyRowType1.Create(lobby, tableType1, JoinGame));
        yield return(new WaitForSeconds(0.1f));

        tableType1.repositionNow = true;
        yield return(new WaitForSeconds(0.2f));

        tableType1.GetComponent <UICenterOnChild>().Recenter();
    }
Example #10
0
 private void onDeleteCallback(DataLobby obj)
 {
     if (Lobbies != null)
     {
         DataLobby lob = Lobbies.Find(i => i.roomId == obj.roomId);
         if (lob != null)
         {
             view.RemoveLobby(obj);
             Lobbies.Remove(lob);
         }
     }
 }
 private void onDeleteCallback(DataLobby obj)
 {
     if (Lobbies != null)
     {
         DataLobby lob = Lobbies.Find(i => i.roomId == obj.roomId);
         if (lob != null)
         {
             view.RemoveLobby(obj);
             Lobbies.Remove(lob);
         }
     }
 }
Example #12
0
 public static LobbyRowType1 Create(DataLobby data, UITable parent, Action<DataLobby> callBack)
 {
     GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType1")) as GameObject;
     go.transform.parent = parent.transform;
     go.transform.localPosition = Vector3.zero;
     go.transform.localScale = Vector3.one;
     go.GetComponent<UIDragScrollView>().scrollView = parent.GetComponentInParent<UIScrollView>();
     go.name = "#" + data.roomId;
     LobbyRowType1 item = go.GetComponent<LobbyRowType1>();
     item.setData(data);
     item.action = callBack;
     return item;
 }
Example #13
0
    public IEnumerator setData(DataLobby data)
    {
        
        yield return new WaitForEndOfFrame();
        this.data = data;
        lbRoomNumber.text = data.roomId.ToString();
        double smallBind = data.gameDetails.betting / 2;
        double minBind = smallBind * 20;
        double maxBind = smallBind * 400;
        lbMoneyStep.text = "$" + smallBind + "/" + data.gameDetails.betting;
        lbMoneyMinMax.text = "$" + Utility.Convert.ConvertShortcutMoney(minBind) + "/" + Utility.Convert.ConvertShortcutMoney(maxBind); 
		lbPeopleNumber.text = data.users.Length + "/" + data.gameDetails.numPlayers;
    }
Example #14
0
    public static LobbyRowType2 Create(DataLobby data, UITable parent)
    {
        GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType2")) as GameObject;

        go.transform.parent        = parent.transform;
        go.transform.localPosition = Vector3.zero;
        go.transform.localScale    = Vector3.one;
        go.name = data.roomId + " - " + data.roomName;
        LobbyRowType2 item = go.GetComponent <LobbyRowType2>();

        item.StartCoroutine(item.setData(data));
        return(item);
    }
Example #15
0
    public IEnumerator setData(DataLobby data)
    {
        yield return(new WaitForEndOfFrame());

        this.data         = data;
        lbRoomNumber.text = data.roomId.ToString();
        double smallBind = data.gameDetails.betting / 2;
        double minBind   = smallBind * 20;
        double maxBind   = smallBind * 400;

        lbMoneyStep.text    = "$" + smallBind + "/" + data.gameDetails.betting;
        lbMoneyMinMax.text  = "$" + Utility.Convert.ConvertShortcutMoney(minBind) + "/" + Utility.Convert.ConvertShortcutMoney(maxBind);
        lbPeopleNumber.text = data.users.Length + "/" + data.gameDetails.numPlayers;
    }
Example #16
0
    public static LobbyRowType1 Create(DataLobby data, UITable parent, Action <DataLobby> callBack)
    {
        GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType1")) as GameObject;

        go.transform.parent        = parent.transform;
        go.transform.localPosition = Vector3.zero;
        go.transform.localScale    = Vector3.one;
        go.GetComponent <UIDragScrollView>().scrollView = parent.GetComponentInParent <UIScrollView>();
        go.name = "#" + data.roomId;
        LobbyRowType1 item = go.GetComponent <LobbyRowType1>();

        item.setData(data);
        item.action = callBack;
        return(item);
    }
Example #17
0
 public void RemoveLobby(DataLobby lobby)
 {
     if (isShowType1)
     {
         LobbyRowType1 lobbyRow = types1.Find(lobbiesView => lobbiesView.data.roomId == lobby.roomId);
         if (lobbyRow != null && lobbyRow.gameObject != null)
         {
             GameObject.Destroy(lobbyRow.gameObject);
             types1.Remove(lobbyRow);
         }
     }
     else
     {
         LobbyRowType2 lobbyRow = types2.Find(lobbiesView => lobbiesView.data.roomId == lobby.roomId);
         GameObject.Destroy(lobbyRow.gameObject);
         types2.Remove(lobbyRow);
     }
 }
Example #18
0
    public void setData(DataLobby lobby)
    {
        for (int i = 0; i < slots.Length; i++)
            slots[i].SetActive(false);

        this.data = lobby;
        double smallBind = lobby.gameDetails.betting / 2;
        title.text = "Phòng : " + lobby.roomId + " - $" + smallBind + "/" + lobby.gameDetails.betting;

        if (data.users != null && data.users.Length > 0)
        {
            foreach (DataPlayerController item in data.users)
            {
                int index = item.slotIndex;
                if (data.gameDetails.numPlayers == 5)
                    index = arrayIndex5Player[item.slotIndex];

                slots[index].SetActive(true);
                slots[index].GetComponent<LobbySlot>().setData(item);
            }
        }
    }
 private void onCreateCallback(DataLobby obj)
 {
     bool canAdded = false;
     if (!IsFiltered)
     {
         if (Lobbies != null && Lobbies.Find(item => item.roomId == obj.roomId) == null)
         {
             canAdded = true;
         }
     }
     else
     {
         List<DataLobby> listLobbyFilter = getListLobbyFilter();
         if (listLobbyFilter.Contains(obj))
         {
             canAdded = true;
         }
     }
     if (canAdded)
     {
         view.AddLobby(obj);
         Lobbies.Add(obj);
     }
 }
Example #20
0
 public void JoinGame(DataLobby lobby)
 {
     presenter.JoinToGame(lobby);
 }
Example #21
0
 public void AddLobby(DataLobby lobby)
 {
     if (isShowType1)
     {
         StartCoroutine(_AddRowType1(lobby));
     }
     else
     {
         StartCoroutine(_AddRowType2(lobby));
     }
 }
Example #22
0
 private void _UpdateLobbyType2(DataLobby lobby)
 {
     LobbyRowType2 lobbyRow = types2.Find(lb => lb.data.roomId == lobby.roomId);
     if (lobbyRow != null)
         lobbyRow.setData(lobby);
 }
Example #23
0
 private void _UpdateLobby(DataLobby lobby)
 {
     if (isShowType1)
     {
         _UpdateLobbyType1(lobby);
     }
     else
     {
         _UpdateLobbyType2(lobby);
     }
 }
Example #24
0
 public void UpdateLobby(DataLobby lobby)
 {
     _UpdateLobby(lobby);
 }
Example #25
0
    public void RemoveLobby(DataLobby lobby)
    {

        if (isShowType1)
        {
            LobbyRowType1 lobbyRow = types1.Find(lobbiesView => lobbiesView.data.roomId == lobby.roomId);
            if (lobbyRow != null && lobbyRow.gameObject != null)
            {
                GameObject.Destroy(lobbyRow.gameObject);
                types1.Remove(lobbyRow);
            }
        }
        else
        {
            LobbyRowType2 lobbyRow = types2.Find(lobbiesView => lobbiesView.data.roomId == lobby.roomId);
            GameObject.Destroy(lobbyRow.gameObject);
            types2.Remove(lobbyRow);
        }
    }
Example #26
0
 private IEnumerator _AddRowType1(DataLobby lobby)
 {
     yield return new WaitForEndOfFrame();
     types1.Add(LobbyRowType1.Create(lobby, tableType1, JoinGame));
     yield return new WaitForSeconds(0.1f);
     tableType1.repositionNow = true;
     yield return new WaitForSeconds(0.2f);
     tableType1.GetComponent<UICenterOnChild>().Recenter();
 }
Example #27
0
 public void JoinGame(DataLobby lobby)
 {
     presenter.JoinToGame(lobby);
 }
 private void onUpdateCallback(DataLobby obj)
 {
     view.UpdateLobby(obj);
     DataLobby lob = Lobbies.Find(i => i.roomId == obj.roomId);
     lob = obj;
 }
Example #29
0
 private IEnumerator _AddRowType2(DataLobby lobby)
 {
     yield return new WaitForEndOfFrame();
     types2.Add(LobbyRowType2.Create(lobby, tableType2));
     tableType2.repositionNow = true;
 }
Example #30
0
    public void setData(DataLobby data)
    {
        this.data = data;
        lbRoomNumber.text = data.roomId.ToString();
		lbPeopleNumber.text = data.users.Length + "/" + data.gameDetails.numPlayers;
    }
Example #31
0
 public void UpdateLobby(DataLobby lobby)
 {
     _UpdateLobby(lobby);
 }