Beispiel #1
0
 private int compareCount(EZBindView a, EZBindView b)
 {
     if (a.getCount() < b.getCount())
     {
         return(-1);
     }
     if (a.getCount() > b.getCount())
     {
         return(1);
     }
     return(0);
 }
Beispiel #2
0
 private int compareType(EZBindView a, EZBindView b)
 {
     if (a.getBindType() == EZBindData.BindType.State)
     {
         if (b.getBindType() != EZBindData.BindType.State)
         {
             return(-1);
         }
     }
     else
     {
         if (b.getBindType() == EZBindData.BindType.State)
         {
             return(1);
         }
     }
     return(0);
 }
Beispiel #3
0
    public int Compare(Transform a, Transform b)
    {
        int        ret   = 0;
        EZBindView aBind = a.gameObject.GetComponent <EZBindView>();
        EZBindView bBind = b.gameObject.GetComponent <EZBindView>();



        ret = this.compareType(aBind, bBind);

        if (ret == 0)
        {
            ret = this.compareCount(aBind, bBind);
        }


        return(ret);
    }
Beispiel #4
0
    public bool has(EZBindData data)
    {
        Predicate <EZBindView> predicate = delegate(EZBindView view) {
            if (view.data.count == data.count)
            {
                return(true);
            }
            ;
            return(false);
        };
        EZBindView bind = datas_.Find(predicate);

        if (bind)
        {
            return(true);
        }
        return(false);
    }
Beispiel #5
0
    public EZBindView dark(EZBindData data)
    {
        Predicate <EZBindView> predicate = delegate(EZBindView view) {
            if (view.data.count == data.count)
            {
                return(true);
            }
            ;
            return(false);
        };
        EZBindView bind = datas_.Find(predicate);

        if (bind)
        {
            bind.dark();
            return(bind);
        }
        return(null);
    }
Beispiel #6
0
    public EZBindView create(EZBindData data)
    {
        GameObject obj = (GameObject)GameObject.Instantiate(this._prototype);

        obj.transform.parent     = this._table.transform;
        obj.name                 = data.style;
        obj.transform.localScale = this._prototype.transform.localScale;
        obj.transform.position   = this._prototype.transform.position;
        obj.SetActive(true);
        EZBindView view = obj.GetComponent <EZBindView>();

        if (view)
        {
            view.data = data;
            datas_.Add(view);
        }
        _table.repositionNow           = true;
        _table.transform.localPosition = tablePosition_;
        data.count = count_;
        count_++;
        return(view);
    }