Ejemplo n.º 1
0
        // Public Methods (12) 

        /// <summary>
        /// Set the values to the result of an AND operation with grid bt
        /// </summary>
        /// <param name="bt"></param>
        public void And(BitGrid3D bt)
        {
            if (bt.Count != Count)
            {
                throw new Exception("Grids are of different sizes");
            }

            for (var i = 0; i < Count; i++)
            {
                SetValue(i, GetValue(i) && bt.GetValue(i));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Set values to the result of an OR operation with grid bt
        /// </summary>
        /// <param name="bt"></param>
        public void Or(BitGrid3D bt)
        {
            if (bt.Count != Count)
            {
                throw new Exception("Grids are of different sizes");
            }

            for (var idx = 0; idx < Count; idx++)
            {
                SetValue(idx, GetValue(idx) || bt.GetValue(idx));
            }
        }