Ejemplo n.º 1
0
 public trigger()
 {
     hiddenNum1 = new closePrime();
     hiddenNum2 = new closePrime();
     areBothActive();
     initializeArr();
     updateStats();
 }
Ejemplo n.º 2
0
        /*
         * INITIALIZEARR:
         * PRECONDITIONS:  Object is active.
         * POSTCONDITIONS: An array of closePrime objects with size arrSize is created and each element is
         *              initialized to a new closePrime object.
         */
        private void initializeArr()
        {
            myPrimeArr = new closePrime[arrSize];

            for (int i = 0; i < arrSize; i++)
            {
                myPrimeArr[i] = new closePrime();
            }
        }
Ejemplo n.º 3
0
        /*
         * ADDOBJ:
         * PRECONDITIONS:  Object can be active or inactive.
         * POSTCONDITIONS: If the number of closePrime objects that occupy
         *                  the array are equal to the size of the array, then
         *                  no objects are added and return false. Otherwise, a
         *                  new closePrime object is added to the array and the
         *                  number of closePrime objects that occupy the array
         *                  increases.
         */
        public bool addObj()
        {
            if (size == arrSize)
            {
                return(false);
            }

            myPrimeArr[size] = new closePrime();
            size++;
            return(true);
        }