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)); }
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))); }
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)); }
public ICommand Desrialize(byte[] bytes, int offset, out int readBytesCount) { readBytesCount = 2; var firstByte = bytes[offset]; var secondByte = bytes[offset + 1]; var unitVector = VectorDeserializer.DeserializeLcdAxis((byte)((firstByte << 2) >> 6)); var length = VectorDeserializer.DeserializeLinearLongLength(secondByte); var direction = unitVector * length; return(new SMoveCommand(direction)); }