示例#1
0
        internal AlchemKey Process(AlchemKey alchemieKey)
        {
            var firstPart  = new AlchemPack(Get(this.NewOrder[0]), Get(this.NewOrder[1]), Get(this.NewOrder[2]), Get(this.NewOrder[3]));
            var secondPart = new AlchemPack(Get(this.NewOrder[4]), Get(this.NewOrder[5]), Get(this.NewOrder[6]), Get(this.NewOrder[7]));
            var thirdPart  = new AlchemPack(Get(this.NewOrder[8]), Get(this.NewOrder[9]), Get(this.NewOrder[10]), Get(this.NewOrder[11]));

            return(new AlchemKey(firstPart, secondPart, thirdPart));


            AlchemieDigit Get(int i)
            {
                if (i < 4)
                {
                    return(alchemieKey[0][i]);
                }
                else if (i < 8)
                {
                    return(alchemieKey[1][i - 4]);
                }
                else if (i < 12)
                {
                    return(alchemieKey[2][i - 8]);
                }
                throw new ArgumentOutOfRangeException(nameof(i), i, "must be between 0 and 11 (inclusive)");
            }
        }
示例#2
0
        private void UpdateData()
        {
            var list = new MyList <AlchemPack>(this.Matrix.Columns);

            for (int x = 0; x < this.Matrix.Columns; x++)
            {
                AlchemPack pack = default;
                for (int y = 0; y < this.Matrix.Rows; y++)
                {
                    pack += this.Matrix[x, y];
                }
                list.Add(pack);
            }
            this.ColumResult = list.AsReadOnly();

            list = new MyList <AlchemPack>(this.Matrix.Rows);
            for (int y = 0; y < this.Matrix.Rows; y++)
            {
                AlchemPack pack = default;
                for (int x = 0; x < this.Matrix.Columns; x++)
                {
                    pack += this.Matrix[x, y];
                }
                list.Add(pack);
            }
            this.RowResult = list.AsReadOnly();
        }