Пример #1
0
        /// <summary>
        /// パラメータで指定した座標にカルノー図の値を設定
        /// </summary>
        /// <param name="x">x座標</param>
        /// <param name="y">y座標</param>
        /// <param name="z">z座標</param>
        /// <param name="value">設定したい値</param>
        public void setMapPoint(IKarnoughComponent value, int x, int y, int z = 0)
        {
            if (z > (z_max - 1))
            {
                int d = z - (z_max - 1);

                for (int i = 0; i < d; i++)
                {
                    addZ();
                }
            }

            if (y > (y_max - 1))
            {
                int d = y - (y_max - 1);
                for (int i = 0; i < d; i++)
                {
                    addY();
                }
            }

            if (x > (x_max - 1))
            {
                int d = x - (x_max - 1);
                for (int i = 0; i < d; i++)
                {
                    addX();
                }
            }

            List <List <IKarnoughComponent> > comList  = valueLists[z];
            List <IKarnoughComponent>         comList2 = comList[y];

            comList2[x] = value;
        }
Пример #2
0
 public AxisKarnoughComponent(IKarnoughComponent com, int x, int y, int z = 0)
 {
     values     = com.values;
     blockValue = com.blockValue;
     this.x     = x;
     this.y     = y;
     this.z     = z;
 }
Пример #3
0
        /// <summary>
        /// パラメーターで指定したカルノー図の値を返す。
        /// </summary>
        /// <param name="x">x座標</param>
        /// <param name="y">y座標</param>
        /// <param name="z">z座標(2次元の時は0)</param>
        /// <returns>カルノー図の要素</returns>
        public IKarnoughComponent getMapPoint(int x, int y, int z = 0)
        {
            if (z_max <= z || y_max <= y || x_max <= x)
            {
                return(new KarnoughComponent(default_value));
            }

            List <List <IKarnoughComponent> > y_list = valueLists[z];
            List <IKarnoughComponent>         x_list = y_list[y];
            IKarnoughComponent outValue = x_list[x];

            return(outValue);
        }