// 49126048c3d19dd5b676b8d39844cf133833b67a
// Generated by the value-object.rb  DO NOT EDIT!!

#import "SCManagedCapturerState.h"

#import <SCFoundation/SCValueObjectHelpers.h>

#import <FastCoding/FastCoder.h>

@implementation SCManagedCapturerState

static ptrdiff_t sSCManagedCapturerStateOffsets[0];
static BOOL sSCManagedCapturerStateHasOffsets;

- (instancetype)initWithIsRunning:(BOOL)isRunning
                isNightModeActive:(BOOL)isNightModeActive
             isPortraitModeActive:(BOOL)isPortraitModeActive
                lowLightCondition:(BOOL)lowLightCondition
                adjustingExposure:(BOOL)adjustingExposure
                   devicePosition:(SCManagedCaptureDevicePosition)devicePosition
                       zoomFactor:(CGFloat)zoomFactor
                   flashSupported:(BOOL)flashSupported
                   torchSupported:(BOOL)torchSupported
                      flashActive:(BOOL)flashActive
                      torchActive:(BOOL)torchActive
                     lensesActive:(BOOL)lensesActive
                  arSessionActive:(BOOL)arSessionActive
               liveVideoStreaming:(BOOL)liveVideoStreaming
               lensProcessorReady:(BOOL)lensProcessorReady
{
    self = [super init];
    if (self) {
        _isRunning = isRunning;
        _isNightModeActive = isNightModeActive;
        _isPortraitModeActive = isPortraitModeActive;
        _lowLightCondition = lowLightCondition;
        _adjustingExposure = adjustingExposure;
        _devicePosition = devicePosition;
        _zoomFactor = zoomFactor;
        _flashSupported = flashSupported;
        _torchSupported = torchSupported;
        _flashActive = flashActive;
        _torchActive = torchActive;
        _lensesActive = lensesActive;
        _arSessionActive = arSessionActive;
        _liveVideoStreaming = liveVideoStreaming;
        _lensProcessorReady = lensProcessorReady;
    }
    return self;
}

#pragma mark - NSCopying

- (instancetype)copyWithZone:(NSZone *)zone
{
    // Immutable object, bypass copy
    return self;
}

#pragma mark - NSCoding

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _isRunning = [aDecoder decodeBoolForKey:@"isRunning"];
        _isNightModeActive = [aDecoder decodeBoolForKey:@"isNightModeActive"];
        _isPortraitModeActive = [aDecoder decodeBoolForKey:@"isPortraitModeActive"];
        _lowLightCondition = [aDecoder decodeBoolForKey:@"lowLightCondition"];
        _adjustingExposure = [aDecoder decodeBoolForKey:@"adjustingExposure"];
        _devicePosition = (SCManagedCaptureDevicePosition)[aDecoder decodeIntegerForKey:@"devicePosition"];
        _zoomFactor = [aDecoder decodeFloatForKey:@"zoomFactor"];
        _flashSupported = [aDecoder decodeBoolForKey:@"flashSupported"];
        _torchSupported = [aDecoder decodeBoolForKey:@"torchSupported"];
        _flashActive = [aDecoder decodeBoolForKey:@"flashActive"];
        _torchActive = [aDecoder decodeBoolForKey:@"torchActive"];
        _lensesActive = [aDecoder decodeBoolForKey:@"lensesActive"];
        _arSessionActive = [aDecoder decodeBoolForKey:@"arSessionActive"];
        _liveVideoStreaming = [aDecoder decodeBoolForKey:@"liveVideoStreaming"];
        _lensProcessorReady = [aDecoder decodeBoolForKey:@"lensProcessorReady"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeBool:_isRunning forKey:@"isRunning"];
    [aCoder encodeBool:_isNightModeActive forKey:@"isNightModeActive"];
    [aCoder encodeBool:_isPortraitModeActive forKey:@"isPortraitModeActive"];
    [aCoder encodeBool:_lowLightCondition forKey:@"lowLightCondition"];
    [aCoder encodeBool:_adjustingExposure forKey:@"adjustingExposure"];
    [aCoder encodeInteger:(NSInteger)_devicePosition forKey:@"devicePosition"];
    [aCoder encodeFloat:_zoomFactor forKey:@"zoomFactor"];
    [aCoder encodeBool:_flashSupported forKey:@"flashSupported"];
    [aCoder encodeBool:_torchSupported forKey:@"torchSupported"];
    [aCoder encodeBool:_flashActive forKey:@"flashActive"];
    [aCoder encodeBool:_torchActive forKey:@"torchActive"];
    [aCoder encodeBool:_lensesActive forKey:@"lensesActive"];
    [aCoder encodeBool:_arSessionActive forKey:@"arSessionActive"];
    [aCoder encodeBool:_liveVideoStreaming forKey:@"liveVideoStreaming"];
    [aCoder encodeBool:_lensProcessorReady forKey:@"lensProcessorReady"];
}

#pragma mark - FasterCoding

- (BOOL)preferFasterCoding
{
    return YES;
}

- (void)encodeWithFasterCoder:(id<FCFasterCoder>)fasterCoder
{
    [fasterCoder encodeBool:_adjustingExposure];
    [fasterCoder encodeBool:_arSessionActive];
    [fasterCoder encodeSInt32:_devicePosition];
    [fasterCoder encodeBool:_flashActive];
    [fasterCoder encodeBool:_flashSupported];
    [fasterCoder encodeBool:_isNightModeActive];
    [fasterCoder encodeBool:_isPortraitModeActive];
    [fasterCoder encodeBool:_isRunning];
    [fasterCoder encodeBool:_lensProcessorReady];
    [fasterCoder encodeBool:_lensesActive];
    [fasterCoder encodeBool:_liveVideoStreaming];
    [fasterCoder encodeBool:_lowLightCondition];
    [fasterCoder encodeBool:_torchActive];
    [fasterCoder encodeBool:_torchSupported];
    [fasterCoder encodeFloat64:_zoomFactor];
}

- (void)decodeWithFasterDecoder:(id<FCFasterDecoder>)fasterDecoder
{
    _adjustingExposure = (BOOL)[fasterDecoder decodeBool];
    _arSessionActive = (BOOL)[fasterDecoder decodeBool];
    _devicePosition = (SCManagedCaptureDevicePosition)[fasterDecoder decodeSInt32];
    _flashActive = (BOOL)[fasterDecoder decodeBool];
    _flashSupported = (BOOL)[fasterDecoder decodeBool];
    _isNightModeActive = (BOOL)[fasterDecoder decodeBool];
    _isPortraitModeActive = (BOOL)[fasterDecoder decodeBool];
    _isRunning = (BOOL)[fasterDecoder decodeBool];
    _lensProcessorReady = (BOOL)[fasterDecoder decodeBool];
    _lensesActive = (BOOL)[fasterDecoder decodeBool];
    _liveVideoStreaming = (BOOL)[fasterDecoder decodeBool];
    _lowLightCondition = (BOOL)[fasterDecoder decodeBool];
    _torchActive = (BOOL)[fasterDecoder decodeBool];
    _torchSupported = (BOOL)[fasterDecoder decodeBool];
    _zoomFactor = (CGFloat)[fasterDecoder decodeFloat64];
}

- (void)setBool:(BOOL)val forUInt64Key:(uint64_t)key
{
    switch (key) {
    case 15633755733674300ULL:
        _adjustingExposure = (BOOL)val;
        break;
    case 11461798188076803ULL:
        _arSessionActive = (BOOL)val;
        break;
    case 12833337784991002ULL:
        _flashActive = (BOOL)val;
        break;
    case 51252237764061994ULL:
        _flashSupported = (BOOL)val;
        break;
    case 1498048848502287ULL:
        _isNightModeActive = (BOOL)val;
        break;
    case 56151582267629469ULL:
        _isPortraitModeActive = (BOOL)val;
        break;
    case 12346172623874083ULL:
        _isRunning = (BOOL)val;
        break;
    case 67168377441917657ULL:
        _lensProcessorReady = (BOOL)val;
        break;
    case 5791542045168142ULL:
        _lensesActive = (BOOL)val;
        break;
    case 28486888710545224ULL:
        _liveVideoStreaming = (BOOL)val;
        break;
    case 24071673583499455ULL:
        _lowLightCondition = (BOOL)val;
        break;
    case 40774429934225315ULL:
        _torchActive = (BOOL)val;
        break;
    case 41333098301057670ULL:
        _torchSupported = (BOOL)val;
        break;
    }
}

- (void)setSInt32:(int32_t)val forUInt64Key:(uint64_t)key
{
    switch (key) {
    case 66264093189780655ULL:
        _devicePosition = (SCManagedCaptureDevicePosition)val;
        break;
    }
}

- (void)setFloat64:(double)val forUInt64Key:(uint64_t)key
{
    switch (key) {
    case 61340640993537628ULL:
        _zoomFactor = (CGFloat)val;
        break;
    }
}

+ (uint64_t)fasterCodingVersion
{
    return 10319810232046341562ULL;
}

+ (uint64_t *)fasterCodingKeys
{
    static uint64_t keys[] = {
        15 /* Total */,
        FC_ENCODE_KEY_TYPE(15633755733674300, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(11461798188076803, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(66264093189780655, FCEncodeTypeSInt32),
        FC_ENCODE_KEY_TYPE(12833337784991002, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(51252237764061994, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(1498048848502287, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(56151582267629469, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(12346172623874083, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(67168377441917657, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(5791542045168142, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(28486888710545224, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(24071673583499455, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(40774429934225315, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(41333098301057670, FCEncodeTypeBool),
        FC_ENCODE_KEY_TYPE(61340640993537628, FCEncodeTypeFloat64),
    };
    return keys;
}

#pragma mark - isEqual

- (BOOL)isEqual:(id)object
{
    if (!SCObjectsIsEqual(self, object, &sSCManagedCapturerStateHasOffsets, sSCManagedCapturerStateOffsets, 15, 0)) {
        return NO;
    }
    SCManagedCapturerState *other = (SCManagedCapturerState *)object;
    if (other->_isRunning != _isRunning) {
        return NO;
    }

    if (other->_isNightModeActive != _isNightModeActive) {
        return NO;
    }

    if (other->_isPortraitModeActive != _isPortraitModeActive) {
        return NO;
    }

    if (other->_lowLightCondition != _lowLightCondition) {
        return NO;
    }

    if (other->_adjustingExposure != _adjustingExposure) {
        return NO;
    }

    if (other->_devicePosition != _devicePosition) {
        return NO;
    }

    if (other->_zoomFactor != _zoomFactor) {
        return NO;
    }

    if (other->_flashSupported != _flashSupported) {
        return NO;
    }

    if (other->_torchSupported != _torchSupported) {
        return NO;
    }

    if (other->_flashActive != _flashActive) {
        return NO;
    }

    if (other->_torchActive != _torchActive) {
        return NO;
    }

    if (other->_lensesActive != _lensesActive) {
        return NO;
    }

    if (other->_arSessionActive != _arSessionActive) {
        return NO;
    }

    if (other->_liveVideoStreaming != _liveVideoStreaming) {
        return NO;
    }

    if (other->_lensProcessorReady != _lensProcessorReady) {
        return NO;
    }

    return YES;
}

- (NSUInteger)hash
{
    NSUInteger subhashes[] = {
        (NSUInteger)_isRunning,         (NSUInteger)_isNightModeActive,  (NSUInteger)_isPortraitModeActive,
        (NSUInteger)_lowLightCondition, (NSUInteger)_adjustingExposure,  (NSUInteger)_devicePosition,
        (NSUInteger)_zoomFactor,        (NSUInteger)_flashSupported,     (NSUInteger)_torchSupported,
        (NSUInteger)_flashActive,       (NSUInteger)_torchActive,        (NSUInteger)_lensesActive,
        (NSUInteger)_arSessionActive,   (NSUInteger)_liveVideoStreaming, (NSUInteger)_lensProcessorReady};
    NSUInteger result = subhashes[0];
    for (int i = 1; i < 15; i++) {
        unsigned long long base = (((unsigned long long)result) << 32 | subhashes[i]);
        base = (~base) + (base << 18);
        base ^= (base >> 31);
        base *= 21;
        base ^= (base >> 11);
        base += (base << 6);
        base ^= (base >> 22);
        result = (NSUInteger)base;
    }
    return result;
}

#pragma mark - Print description in console: lldb> po #{variable name}

- (NSString *)description
{
    NSMutableString *desc = [NSMutableString string];
    [desc appendString:@"{\n"];
    [desc appendFormat:@"\tisRunning:%@\n", [@(_isRunning) description]];
    [desc appendFormat:@"\tisNightModeActive:%@\n", [@(_isNightModeActive) description]];
    [desc appendFormat:@"\tisPortraitModeActive:%@\n", [@(_isPortraitModeActive) description]];
    [desc appendFormat:@"\tlowLightCondition:%@\n", [@(_lowLightCondition) description]];
    [desc appendFormat:@"\tadjustingExposure:%@\n", [@(_adjustingExposure) description]];
    [desc appendFormat:@"\tdevicePosition:%@\n", [@(_devicePosition) description]];
    [desc appendFormat:@"\tzoomFactor:%@\n", [@(_zoomFactor) description]];
    [desc appendFormat:@"\tflashSupported:%@\n", [@(_flashSupported) description]];
    [desc appendFormat:@"\ttorchSupported:%@\n", [@(_torchSupported) description]];
    [desc appendFormat:@"\tflashActive:%@\n", [@(_flashActive) description]];
    [desc appendFormat:@"\ttorchActive:%@\n", [@(_torchActive) description]];
    [desc appendFormat:@"\tlensesActive:%@\n", [@(_lensesActive) description]];
    [desc appendFormat:@"\tarSessionActive:%@\n", [@(_arSessionActive) description]];
    [desc appendFormat:@"\tliveVideoStreaming:%@\n", [@(_liveVideoStreaming) description]];
    [desc appendFormat:@"\tlensProcessorReady:%@\n", [@(_lensProcessorReady) description]];
    [desc appendString:@"}\n"];

    return [desc copy];
}

@end