








#import "OddSmartNotWin.h"

#define SheAllSoloist self.frame.size.width

@interface OddSmartNotWin()



@property (nonatomic, strong) NSMutableArray                            *decibelArray;



@property (nonatomic, strong) NSMutableArray <FaceClangInputCell *>      *nearArray;



@property (strong, nonatomic) NSMutableArray <FaceClangInputCell *>      *fingerSecond;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) StarRacePurchasedExchangesInter                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   itsCar;

@end

@implementation OddSmartNotWin

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.status = IssuerAnalysisSockIndirectInverseMartial;
    }
    return self;
}

- (void)spaRawReview
{
    
    if (self.nearArray.firstObject) {
        
        
        FaceClangInputCell *nextMixView = self.nearArray.firstObject;
        
        nextMixView.frame = CGRectMake(SheAllSoloist, 0, nextMixView.winRearSize.width, nextMixView.winRearSize.height);
        
        self.itsCar = nextMixView.itsCar;
        
        self.channelCount = nextMixView.channelCount;
        
        
        NSInteger row = [self grantedSuffixYearSpecificBoxReversedTurn:nextMixView];
        
        
        if (row >= 0) {
            
            
            [self.nearArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:nextMixView]) {
                [self addSubview:nextMixView];
            }
            nextMixView.frame = CGRectMake(SheAllSoloist,  row * (nextMixView.winRearSize.height + _itsCar), nextMixView.winRearSize.width, nextMixView.winRearSize.height);
            
            
            [_decibelArray setObject:nextMixView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(slabChildrenView:willDisplayCell:)]) {
                [self.delegate slabChildrenView:self willDisplayCell:nextMixView];
            }
            
            
            [self.fingerSecond addObject:nextMixView];
            
            [nextMixView disabledVariablesSwimmingImproperGravity:^{
                
                
                [nextMixView setTransform:CGAffineTransformMakeTranslation(- nextMixView.frame.size.width-SheAllSoloist, 0)];
                
            } completion:^(BOOL finished) {
                
                [nextMixView removeFromSuperview];
                
                
                [self.fingerSecond removeObject:nextMixView];
                
                
                if ([self.delegate respondsToSelector:@selector(slabChildrenView:didEndDisplayingCell:)]) {
                    [self.delegate slabChildrenView:self didEndDisplayingCell:nextMixView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(assignExchangesQuotesDownAnySlideLoadMark:)]) {
                        [self.delegate assignExchangesQuotesDownAnySlideLoadMark:self];
                    }
                    self.count = 0;
                }
                
                

            }];
        }
    }
    
    [self performSelector:@selector(spaRawReview) withObject:nil afterDelay:0.45f];
}


- (void)insideKilobits:(NSArray <FaceClangInputCell *> *)barrages
{
    self.count += barrages.count;
    [self.nearArray addObjectsFromArray:barrages];
}

- (void)start
{
    if (self.status == DimensionVitalGesturesKannadaTertiarySemicolon) {
        return;
    }
    self.status = DimensionVitalGesturesKannadaTertiarySemicolon;
    
    [self spaRawReview];
}

- (void)stop
{
    if (self.status == IssuerAnalysisSockIndirectInverseMartial) {
        return;
    }
    self.status = IssuerAnalysisSockIndirectInverseMartial;
    
    if (self.fingerSecond.count) {
        [self.fingerSecond makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.nearArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.fingerSecond  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.fingerSecond  removeAllObjects];
    [self.nearArray     removeAllObjects];
    [self.decibelArray  removeAllObjects];
    
    self.fingerSecond       = nil;
    self.nearArray          = nil;
    self.decibelArray       = nil;
}


- (NSInteger)grantedSuffixYearSpecificBoxReversedTurn:(FaceClangInputCell *)newBarrage
{
    for (int row = 0; row<_decibelArray.count; row++) {
        NSObject *object = _decibelArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[FaceClangInputCell class]]) { 
            
            FaceClangInputCell *jobSockKin = (FaceClangInputCell*)object;
            
            if ([self grantedSuffixYearSpecificBoxReversedTurn:jobSockKin eyeIndent:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)grantedSuffixYearSpecificBoxReversedTurn:(FaceClangInputCell *)jobSockKin eyeIndent:(FaceClangInputCell *)newBarrage
{
    
    if (jobSockKin.status == SilencePercentProfileGetOverallConductor) {
        return NO;
    }
    
    
    CGRect rect = [jobSockKin.layer.presentationLayer frame];
    if (rect.origin.x>SheAllSoloist - jobSockKin.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (jobSockKin.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = SheAllSoloist/(SheAllSoloist+newBarrage.frame.size.width)*newBarrage.retTrackKeep;
        
        CGFloat face = rect.origin.x - time/(jobSockKin.retTrackKeep)*(SheAllSoloist + jobSockKin.frame.size.width);
        if (face < -jobSockKin.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *under = [touches anyObject];
    CGPoint dueSuggest  = [under locationInView:self];
    for (FaceClangInputCell *nextMixView in [self subviews])
    {
        if ([nextMixView.layer.presentationLayer hitTest:dueSuggest])
        {
            
            if ([self.delegate respondsToSelector:@selector(slabChildrenView:farConcludeCell:)]) {
                [self.delegate slabChildrenView:self farConcludeCell:nextMixView];
            }
            break;
        }
    }
}




- (NSMutableArray<FaceClangInputCell *> *)nearArray {
    if (!_nearArray) {
        _nearArray = [[NSMutableArray alloc] init];
    }
    return _nearArray;
}


- (NSMutableArray<FaceClangInputCell *> *)fingerSecond {
    if (!_fingerSecond) {
        _fingerSecond = [[NSMutableArray alloc] init];
    }
    return _fingerSecond;
}


- (void)setChannelCount:(NSInteger)channelCount
{
    
    if (self.decibelArray.count < channelCount) { 
        
        for (NSInteger row = self.decibelArray.count; row < channelCount; row++) {
            NSNumber *number = [NSNumber numberWithBool:YES];
            [self.decibelArray setObject:number atIndexedSubscript:row];
        }
        
    }else {
        
        for (NSInteger row = channelCount; row < self.decibelArray.count; row++) {
            [self.decibelArray removeObjectAtIndex:row];
        }
    }
    
    _channelCount = channelCount;
    
}


- (NSMutableArray *)decibelArray {
    if (!_decibelArray) {
        _decibelArray = [[NSMutableArray alloc] init];
    }
    return _decibelArray;
}

@end
