public ICommand Desrialize(byte[] bytes, int offset, out int readBytesCount)
        {
            readBytesCount = 1;
            var codedNd      = (byte)((bytes[offset] & 0b1111_1000) >> 3);
            var nearDistance = VectorDeserializer.DeserializeNearDifference(codedNd);

            return(new FillCommand(nearDistance));
        }
Exemple #2
0
        public ICommand Desrialize(byte[] bytes, int offset, out int readBytesCount)
        {
            readBytesCount = 4;
            var firstByte    = bytes[offset];
            var codedNd      = (byte)((firstByte & 0b1111_1000) >> 3);
            var nearDistance = VectorDeserializer.DeserializeNearDifference(codedNd);

            return(new GVoidCommand(nearDistance,
                                    new Vector(bytes[offset + 1] - 30, bytes[offset + 2] - 30, bytes[offset + 3] - 30)));
        }
Exemple #3
0
        public ICommand Desrialize(byte[] bytes, int offset, out int readBytesCount)
        {
            readBytesCount = 2;
            var firstByte    = bytes[offset];
            var secondByte   = bytes[offset + 1];
            var codedNd      = (byte)((firstByte & 0b1111_1000) >> 3);
            var nearDistance = VectorDeserializer.DeserializeNearDifference(codedNd);

            return(new FissionCommand(nearDistance, secondByte));
        }