} // getInt()

        private bool?getBoolean(string key)
        {
            object obj = get(key);

            if (obj == null)
            {
                return(null);
            }
            return(BooleanComparator.toBoolean(obj));
        } // getBoolean()
        } // select()

        protected object createOperand(string token, SelectItem leftSelectItem, bool searchSelectItems)
        {
            if (token.Equals("NULL", StringComparison.CurrentCultureIgnoreCase))
            {
                return(null);
            }

            if (token.StartsWith("'") && token.EndsWith("'") && token.Length > 2)
            {
                string stringOperand = token.Substring(1, token.Length - 1);
                //[J2N] replaceAll <=>  Replace
                stringOperand = stringOperand.Replace("\\\\'", "'");
                return(stringOperand);
            }

            if (searchSelectItems)
            {
                SelectItem selectItem = findSelectItem(token, false);
                if (selectItem != null)
                {
                    return(selectItem);
                }
            }

            ColumnType expectedColumnType = leftSelectItem.getExpectedColumnType();
            object     result             = null;

            if (expectedColumnType == null)
            {
                // We're assuming number here, but it could also be boolean or a
                // time based type. But anyways, this should not happen since
                // expected column type should be available.
                result = NumberComparator.toNumber(token);
            }
            else if (expectedColumnType.isBoolean())
            {
                result = BooleanComparator.toBoolean(token);
            }
            //    else if (expectedColumnType.isTimeBased())
            //    {
            //        result = FormatHelper.parseSqlTime(expectedColumnType, token);
            //    }
            //    else
            //    {
            //        result = NumberComparator.toNumber(token);
            //    }

            //    if (result == null)
            //    {
            //        // shouldn't happen since only "NULL" is parsed as null.
            //        throw new QueryParserException("Could not parse operand: " + token);
            //    }

            return(result);
        } // createOperand()
Exemplo n.º 3
0
        // Use this for initialization
        void Start()
        {
            InvokeRepeating("LookForPlayer", 0, 2);
            StartCoroutine(WaitUntilPlayerIsDeath());
            startPosition       = transform.position;
            canvas              = GameObject.FindWithTag("Canvas").GetComponent <Canvas>();
            mainCamera          = GameObject.FindWithTag("MainCamera").GetComponent <Camera>();
            enemyHPOffset       = GM.FindChildWithTag("EnemyHP", transform).transform;
            animator            = GetComponent <Animator>();
            takingHitComparator = GetComponent <BooleanComparator>();

            if (brain is Tamana.AI.AI_LastBoss)
            {
                isLastBoss = true;
            }

            if (brain != null)
            {
                brain.ai = this;
            }

            aiStrafing = gameObject.AddComponent <BaseAI_Strafing>();
            aiStrafing.SetUp(this);
            aiAttack = gameObject.AddComponent <BaseAI_Attack>();
            aiAttack.SetUp(this, lightAttack, mediumAttack, heavyAttack);
            aiDeath = gameObject.AddComponent <BaseAI_Death>();
            aiDeath.SetUp(this);
            aiBlock = gameObject.AddComponent <BaseAI_Block>();
            aiBlock.SetUp(this);

            baseStatus    = new Status(100, 100, 50, 20);
            currentStatus = baseStatus;

            StartCoroutine(AddLearningPointWhenDeath());

            brain.aiStart();
        }
Exemplo n.º 4
0
 public BooleanComparatorTest()
 {
     this.BooleanComparator = new BooleanComparator();
 }
Exemplo n.º 5
0
 /**
  * Gets a Comparator that can sort bool objects.
  * <p>
  * The parameter specifies whether true or false is sorted first.
  * <p>
  * The comparator throws NullPointerException if a null value is compared.
  *
  * @param trueFirst  when <code>true</code>, sort
  *        <code>true</code> {@link Boolean}s before
  *        <code>false</code> {@link Boolean}s.
  * @return  a comparator that sorts booleans
  */
 public static java.util.Comparator <Object> booleanComparator(bool trueFirst)
 {
     return(BooleanComparator.getBooleanComparator(trueFirst));
 }