








#import "MountBlackSent.h"

#define LiterBarSerif self.frame.size.width

@interface MountBlackSent()



@property (nonatomic, strong) NSMutableArray                            *anySaltArray;



@property (nonatomic, strong) NSMutableArray <LoseMapDarkCupCell *>      *stayArray;



@property (strong, nonatomic) NSMutableArray <LoseMapDarkCupCell *>      *vowelVerbose;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) YetShuffleChatMarathiRemote                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   illLow;

@end

@implementation MountBlackSent

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

- (void)sexAccording
{
    
    if (self.stayArray.firstObject) {
        
        
        LoseMapDarkCupCell *tapFlatView = self.stayArray.firstObject;
        
        tapFlatView.frame = CGRectMake(LiterBarSerif, 0, tapFlatView.hasFreeSize.width, tapFlatView.hasFreeSize.height);
        
        self.illLow = tapFlatView.illLow;
        
        self.channelCount = tapFlatView.channelCount;
        
        
        NSInteger row = [self genderItalicHistorySharingLappishFolderEye:tapFlatView];
        
        
        if (row >= 0) {
            
            
            [self.stayArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:tapFlatView]) {
                [self addSubview:tapFlatView];
            }
            tapFlatView.frame = CGRectMake(LiterBarSerif,  row * (tapFlatView.hasFreeSize.height + _illLow), tapFlatView.hasFreeSize.width, tapFlatView.hasFreeSize.height);
            
            
            [_anySaltArray setObject:tapFlatView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(pingExporterView:willDisplayCell:)]) {
                [self.delegate pingExporterView:self willDisplayCell:tapFlatView];
            }
            
            
            [self.vowelVerbose addObject:tapFlatView];
            
            [tapFlatView staticInvalidBasicNeverCoast:^{
                
                
                [tapFlatView setTransform:CGAffineTransformMakeTranslation(- tapFlatView.frame.size.width-LiterBarSerif, 0)];
                
            } completion:^(BOOL finished) {
                
                [tapFlatView removeFromSuperview];
                
                
                [self.vowelVerbose removeObject:tapFlatView];
                
                
                if ([self.delegate respondsToSelector:@selector(pingExporterView:didEndDisplayingCell:)]) {
                    [self.delegate pingExporterView:self didEndDisplayingCell:tapFlatView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(segmentedGlyphAnalysisInfoRegionPortCapturedRequest:)]) {
                        [self.delegate segmentedGlyphAnalysisInfoRegionPortCapturedRequest:self];
                    }
                    self.count = 0;
                }
                
                

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


- (void)loudPrepDaySpa:(NSArray <LoseMapDarkCupCell *> *)barrages
{
    self.count += barrages.count;
    [self.stayArray addObjectsFromArray:barrages];
}

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

- (void)stop
{
    if (self.status == BrotherMaintainFixIncorrectSolveLaw) {
        return;
    }
    self.status = BrotherMaintainFixIncorrectSolveLaw;
    
    if (self.vowelVerbose.count) {
        [self.vowelVerbose makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.stayArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.vowelVerbose  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.vowelVerbose  removeAllObjects];
    [self.stayArray     removeAllObjects];
    [self.anySaltArray  removeAllObjects];
    
    self.vowelVerbose       = nil;
    self.stayArray          = nil;
    self.anySaltArray       = nil;
}


- (NSInteger)genderItalicHistorySharingLappishFolderEye:(LoseMapDarkCupCell *)newBarrage
{
    for (int row = 0; row<_anySaltArray.count; row++) {
        NSObject *object = _anySaltArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[LoseMapDarkCupCell class]]) { 
            
            LoseMapDarkCupCell *mildTwoMid = (LoseMapDarkCupCell*)object;
            
            if ([self genderItalicHistorySharingLappishFolderEye:mildTwoMid inputGray:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)genderItalicHistorySharingLappishFolderEye:(LoseMapDarkCupCell *)mildTwoMid inputGray:(LoseMapDarkCupCell *)newBarrage
{
    
    if (mildTwoMid.status == NowNeedPaperKitSpaVirtual) {
        return NO;
    }
    
    
    CGRect rect = [mildTwoMid.layer.presentationLayer frame];
    if (rect.origin.x>LiterBarSerif - mildTwoMid.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (mildTwoMid.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = LiterBarSerif/(LiterBarSerif+newBarrage.frame.size.width)*newBarrage.capRowsAgent;
        
        CGFloat scan = rect.origin.x - time/(mildTwoMid.capRowsAgent)*(LiterBarSerif + mildTwoMid.frame.size.width);
        if (scan < -mildTwoMid.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *wrist = [touches anyObject];
    CGPoint beenCredit  = [wrist locationInView:self];
    for (UIView *usedAir in [self subviews])
    {
        if (![usedAir isKindOfClass:[LoseMapDarkCupCell class]]) continue;
        LoseMapDarkCupCell *tapFlatView = (LoseMapDarkCupCell *)usedAir;
        if ([tapFlatView.layer.presentationLayer hitTest:beenCredit])
        {
            
            if ([self.delegate respondsToSelector:@selector(pingExporterView:checkerHighCell:)]) {
                [self.delegate pingExporterView:self checkerHighCell:tapFlatView];
            }
            break;
        }
    }
}




- (NSMutableArray<LoseMapDarkCupCell *> *)stayArray {
    if (!_stayArray) {
        _stayArray = [[NSMutableArray alloc] init];
    }
    return _stayArray;
}


- (NSMutableArray<LoseMapDarkCupCell *> *)vowelVerbose {
    if (!_vowelVerbose) {
        _vowelVerbose = [[NSMutableArray alloc] init];
    }
    return _vowelVerbose;
}


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


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

@end
