Пример #1
0
        private static Command ReadVoid(int b1, Stream stream)
        {
            int   n  = (b1 & 0b11111000) >> 3;
            Delta nd = DeltaDecoder.DecodeNd(n);

            return(Commands.Void(nd));
        }
Пример #2
0
        private static Command ReadSMove(int b1, Stream stream)
        {
            int   b2  = stream.StrictReadByte();
            int   a   = (b1 & 0b00110000) >> 4;
            int   i   = (b2 & 0b00011111) >> 0;
            Delta lld = DeltaDecoder.DecodeLld(a, i);

            return(Commands.SMove(lld));
        }
Пример #3
0
        private static Command ReadFission(int b1, Stream stream)
        {
            int   b2 = stream.StrictReadByte();
            int   n  = (b1 & 0b11111000) >> 3;
            int   m  = (b2 & 0b00000000) >> 0;
            Delta nd = DeltaDecoder.DecodeNd(n);

            return(Commands.Fission(nd, m));
        }
Пример #4
0
            internal override Command Decode(int prefix, Func <int> nextByte)
            {
                int   suffix = nextByte();
                int   a      = (prefix & 0b00110000) >> 4;
                int   i      = (suffix & 0b00011111) >> 0;
                Delta lld    = DeltaDecoder.DecodeLld(a, i);

                return(Commands.SMove(lld));
            }
Пример #5
0
        private static Command ReadGVoid(int b1, Stream stream)
        {
            int   n  = (b1 & 0b11111000) >> 3;
            int   dx = stream.StrictReadByte();
            int   dy = stream.StrictReadByte();
            int   dz = stream.StrictReadByte();
            Delta nd = DeltaDecoder.DecodeNd(n);
            Delta fd = DeltaDecoder.DecodeFd(dx, dy, dz);

            return(Commands.GVoid(nd, fd));
        }
Пример #6
0
        private static Command ReadLMove(int b1, Stream stream)
        {
            int   b2   = stream.StrictReadByte();
            int   a1   = (b1 & 0b00110000) >> 4;
            int   i1   = (b2 & 0b00001111) >> 0;
            int   a2   = (b1 & 0b11000000) >> 6;
            int   i2   = (b2 & 0b11110000) >> 4;
            Delta sld1 = DeltaDecoder.DecodeSld(a1, i1);
            Delta sld2 = DeltaDecoder.DecodeSld(a2, i2);

            return(Commands.LMove(sld1, sld2));
        }
Пример #7
0
            internal override Command Decode(int prefix, Func <int> nextByte)
            {
                int   suffix = nextByte();
                int   a1     = (prefix & 0b00110000) >> 4;
                int   i1     = (suffix & 0b00001111) >> 0;
                int   a2     = (prefix & 0b11000000) >> 6;
                int   i2     = (suffix & 0b11110000) >> 4;
                Delta sld1   = DeltaDecoder.DecodeSld(a1, i1);
                Delta sld2   = DeltaDecoder.DecodeSld(a2, i2);

                return(Commands.LMove(sld1, sld2));
            }