void UpdateSelectedChecker() { if (OnCheckerSelected != null) { IPropertyChecker checker = checkers[selectedItemIndex]; if (notToggle.isNot) { checker = new PropertyCheckers.Not(checker); } OnCheckerSelected(checker); } }
void Start() { gc = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>(); checkers = new List <IPropertyChecker>(); //generate all checks checkers.Add(new PropertyCheckers.Identity()); foreach (string property in gc.pieceInfo.properties.Keys) { foreach (string value in gc.pieceInfo.properties[property]) { checkers.Add(new PropertyCheckers.PropertyHasValue(property, value)); } } //TODO - piece specific properties e.g. face value etc. //generate the selectable list for (int i = 0; i < checkers.Count; i++) { IPropertyChecker check = checkers[i]; DropDownListItem listItem = Instantiate(listItemPrefab).GetComponent <DropDownListItem>(); listItem.transform.SetParent(dropDownList); listItem.Init(this, check.ToString(), i); } /* * //add the negations of each property * for(int i = 0; i < checkers.Count; i++) { * IPropertyChecker check = new PropertyCheckers.Not(checkers[i]); * DropDownListItem listItem = Instantiate(listItemPrefab).GetComponent<DropDownListItem>(); * listItem.transform.SetParent(dropDownList); * listItem.Init(this, check.ToString(), i); * * } */ dropDownList.gameObject.SetActive(false); selectedItemIndex = -1; }
public void SetPropertyCheck(IPropertyChecker checker) { node.SetPropertyCheck(checker); }
public void SetPropertyFilter(IPropertyChecker checker) { node.SetFilter(checker); }
public ExistsOneHas (IPropertyChecker propertyCheck) { this.propertyCheck = propertyCheck; this.filter = new PropertyCheckers.Identity(); }
public void AddChecker(IPropertyChecker <T, TProperty> checker) { CurrentChecker = checker; checkers.Add(checker); }
public void SetPropertyCheck(IPropertyChecker check) { this.propertyCheck = check; }
public AllHave(IPropertyChecker propertyCheck, IPropertyChecker filter) { this.propertyCheck = propertyCheck; this.filter = filter; }
public IRuleBuilder <T, TProperty> SetChecker(IPropertyChecker <T, TProperty> checker) { Rule.AddChecker(checker); return(this); }
public PropertyCount(IPropertyChecker propertyCheck, IComparer <int> countComparator, int amount) { this.propertyCheck = propertyCheck; this.countComparator = countComparator; this.amount = amount; }
public Not(IPropertyChecker child) { this.child = child; }
public PropertyCount (IPropertyChecker propertyCheck, IComparer<int> countComparator, int amount) { this.propertyCheck = propertyCheck; this.countComparator = countComparator; this.amount = amount; }
public ExistsOneHas(IPropertyChecker propertyCheck) { this.propertyCheck = propertyCheck; this.filter = new PropertyCheckers.Identity(); }
public ExistsOneHas(IPropertyChecker propertyCheck, IPropertyChecker filter) { this.propertyCheck = propertyCheck; this.filter = filter; }
public AllHave (IPropertyChecker propertyCheck) { this.propertyCheck = propertyCheck; this.filter = new PropertyCheckers.Identity(); }
public void SetFilter(IPropertyChecker check) { this.filter = check; }
public AllHave(IPropertyChecker propertyCheck) { this.propertyCheck = propertyCheck; this.filter = new PropertyCheckers.Identity(); }