fCraft.GUI.IsoCat.GetBlock C# (CSharp) Метод

GetBlock() приватный Метод

private GetBlock ( int xx, int yy, int zz ) : byte
xx int
yy int
zz int
Результат byte
        private byte GetBlock( int xx, int yy, int zz )
        {
            int realx;
            int realy;
            switch ( Rot ) {
                case 0:
                    realx = xx;
                    realy = yy;
                    break;

                case 1:
                    realx = dimX1 - yy;
                    realy = xx;
                    break;

                case 2:
                    realx = dimX1 - xx;
                    realy = dimY1 - yy;
                    break;

                default:
                    realx = yy;
                    realy = dimY1 - xx;
                    break;
            }
            int pos = ( zz * dimY + realy ) * dimX + realx;

            if ( Mode == IsoCatMode.Normal ) {
                return bp[pos];
            } else if ( Mode == IsoCatMode.Peeled && ( xx == ( Rot == 1 || Rot == 3 ? dimY1 : dimX1 ) || yy == ( Rot == 1 || Rot == 3 ? dimX1 : dimY1 ) || zz == Map.Height - 1 ) ) {
                return 0;
            } else if ( Mode == IsoCatMode.Cut && xx > ( Rot == 1 || Rot == 3 ? dimY2 : dimX2 ) && yy > ( Rot == 1 || Rot == 3 ? dimX2 : dimY2 ) ) {
                return 0;
            } else if ( Mode == IsoCatMode.Chunk && ( realx < ChunkCoords[0] || realy < ChunkCoords[1] || zz < ChunkCoords[2] || realx > ChunkCoords[3] || realy > ChunkCoords[4] || zz > ChunkCoords[5] ) ) {
                return 0;
            }

            return bp[pos];
        }