private int compareCount(EZBindView a, EZBindView b) { if (a.getCount() < b.getCount()) { return(-1); } if (a.getCount() > b.getCount()) { return(1); } return(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); }
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); }
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); }
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); }
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); }