Esempio n. 1
0
        public X9(int[,] array, int maxSize, int i, int j)
        {
            _x9[0, 0] = new XCell(i - 1, j - 1, array, maxSize);
            _x9[1, 0] = new XCell(i, j - 1, array, maxSize);
            _x9[2, 0] = new XCell(i + 1, j - 1, array, maxSize);

            _x9[0, 1] = new XCell(i - 1, j, array, maxSize);
            _x9[1, 1] = new XCell(i, j, array, maxSize);
            _x9[2, 1] = new XCell(i + 1, j, array, maxSize);

            _x9[0, 2] = new XCell(i - 1, j + 1, array, maxSize);
            _x9[1, 2] = new XCell(i, j + 1, array, maxSize);
            _x9[2, 2] = new XCell(i + 1, j + 1, array, maxSize);
        }
Esempio n. 2
0
        public MergeResult AddItem(XCell item, MergeResult mr)
        {
            if (item.Consider)
            {
                return(new MergeResult()
                {
                    Value = mr.Value + item.V,
                    SumItemsNew = mr.SumItemsNew,
                });
            }

            return(new MergeResult()
            {
                Value = mr.Value,
                SumItemsNew = --mr.SumItemsNew
            });
        }