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

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

            return(this);
        }
예제 #11
0
 public PropertyCount(IPropertyChecker propertyCheck, IComparer <int> countComparator, int amount)
 {
     this.propertyCheck   = propertyCheck;
     this.countComparator = countComparator;
     this.amount          = amount;
 }
예제 #12
0
		public Not(IPropertyChecker child)
		{
			this.child = child;
		}
예제 #13
0
	public PropertyCount (IPropertyChecker propertyCheck, IComparer<int> countComparator, int amount)
	{
		this.propertyCheck = propertyCheck;
		this.countComparator = countComparator;
		this.amount = amount;
	}
예제 #14
0
 public ExistsOneHas(IPropertyChecker propertyCheck)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = new PropertyCheckers.Identity();
 }
예제 #15
0
 public ExistsOneHas(IPropertyChecker propertyCheck, IPropertyChecker filter)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = filter;
 }
예제 #16
0
	public AllHave (IPropertyChecker propertyCheck)
	{
		this.propertyCheck = propertyCheck;
		this.filter = new PropertyCheckers.Identity();
	}
예제 #17
0
	public AllHave(IPropertyChecker propertyCheck, IPropertyChecker filter)
	{
		this.propertyCheck = propertyCheck;
		this.filter = filter;
	}
예제 #18
0
 public void SetPropertyCheck(IPropertyChecker check)
 {
     this.propertyCheck = check;
 }
예제 #19
0
	public void SetFilter(IPropertyChecker check)
	{
		this.filter = check;
	}
예제 #20
0
 public void SetFilter(IPropertyChecker check)
 {
     this.filter = check;
 }
예제 #21
0
	public void SetPropertyFilter(IPropertyChecker checker)
	{
		node.SetFilter(checker);
	}
예제 #22
0
 public AllHave(IPropertyChecker propertyCheck)
 {
     this.propertyCheck = propertyCheck;
     this.filter        = new PropertyCheckers.Identity();
 }
예제 #23
0
 public Not(IPropertyChecker child)
 {
     this.child = child;
 }
예제 #24
0
	public ExistsOneHas(IPropertyChecker propertyCheck, IPropertyChecker filter)
	{
		this.propertyCheck = propertyCheck;
		this.filter = filter;
	}