Exemple #1
0
 void UpdateSelectedChecker()
 {
     if (OnCheckerSelected != null)
     {
         IPropertyChecker checker = checkers[selectedItemIndex];
         if (notToggle.isNot)
         {
             checker = new PropertyCheckers.Not(checker);
         }
         OnCheckerSelected(checker);
     }
 }
Exemple #2
0
    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;
    }
Exemple #3
0
 public void SetPropertyCheck(IPropertyChecker checker)
 {
     node.SetPropertyCheck(checker);
 }
Exemple #4
0
 public void SetPropertyFilter(IPropertyChecker checker)
 {
     node.SetFilter(checker);
 }
	public ExistsOneHas (IPropertyChecker propertyCheck)
	{
		this.propertyCheck = propertyCheck;
		this.filter = new PropertyCheckers.Identity();
	}
Exemple #6
0
	public void SetPropertyCheck(IPropertyChecker checker)
	{
		node.SetPropertyCheck(checker);
	}
Exemple #7
0
        public void AddChecker(IPropertyChecker <T, TProperty> checker)
        {
            CurrentChecker = checker;

            checkers.Add(checker);
        }
Exemple #8
0
	public void SetPropertyCheck(IPropertyChecker check)
	{
		this.propertyCheck = check;
	}
Exemple #9
0
 public AllHave(IPropertyChecker propertyCheck, IPropertyChecker filter)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = filter;
 }
Exemple #10
0
        public IRuleBuilder <T, TProperty> SetChecker(IPropertyChecker <T, TProperty> checker)
        {
            Rule.AddChecker(checker);

            return(this);
        }
Exemple #11
0
 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;
	}
Exemple #14
0
 public ExistsOneHas(IPropertyChecker propertyCheck)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = new PropertyCheckers.Identity();
 }
Exemple #15
0
 public ExistsOneHas(IPropertyChecker propertyCheck, IPropertyChecker filter)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = filter;
 }
Exemple #16
0
	public AllHave (IPropertyChecker propertyCheck)
	{
		this.propertyCheck = propertyCheck;
		this.filter = new PropertyCheckers.Identity();
	}
Exemple #17
0
	public AllHave(IPropertyChecker propertyCheck, IPropertyChecker filter)
	{
		this.propertyCheck = propertyCheck;
		this.filter = filter;
	}
Exemple #18
0
 public void SetPropertyCheck(IPropertyChecker check)
 {
     this.propertyCheck = check;
 }
Exemple #19
0
	public void SetFilter(IPropertyChecker check)
	{
		this.filter = check;
	}
Exemple #20
0
 public void SetFilter(IPropertyChecker check)
 {
     this.filter = check;
 }
Exemple #21
0
	public void SetPropertyFilter(IPropertyChecker checker)
	{
		node.SetFilter(checker);
	}
Exemple #22
0
 public AllHave(IPropertyChecker propertyCheck)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = new PropertyCheckers.Identity();
 }
 public Not(IPropertyChecker child)
 {
     this.child = child;
 }
	public ExistsOneHas(IPropertyChecker propertyCheck, IPropertyChecker filter)
	{
		this.propertyCheck = propertyCheck;
		this.filter = filter;
	}