








#import "OrangeVariable.h"

#define EarLockingOpt self.frame.size.width

@interface OrangeVariable()



@property (nonatomic, strong) NSMutableArray                            *editFunArray;



@property (nonatomic, strong) NSMutableArray <RealHexSubLessCell *>      *drumArray;



@property (strong, nonatomic) NSMutableArray <RealHexSubLessCell *>      *ampereBitmap;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) BrushComponentAngularPlatePub                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   howWon;

@end

@implementation OrangeVariable

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

- (void)sixBeganTeam
{
    
    if (self.drumArray.firstObject) {
        
        
        RealHexSubLessCell *headFitView = self.drumArray.firstObject;
        
        headFitView.frame = CGRectMake(EarLockingOpt, 0, headFitView.useSwapSize.width, headFitView.useSwapSize.height);
        
        self.howWon = headFitView.howWon;
        
        self.channelCount = headFitView.channelCount;
        
        
        NSInteger row = [self millionStarSuccessSuggestedZeroFaceVolumes:headFitView];
        
        
        if (row >= 0) {
            
            
            [self.drumArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:headFitView]) {
                [self addSubview:headFitView];
            }
            headFitView.frame = CGRectMake(EarLockingOpt,  row * (headFitView.useSwapSize.height + _howWon), headFitView.useSwapSize.width, headFitView.useSwapSize.height);
            
            
            [_editFunArray setObject:headFitView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(armourEarCatView:willDisplayCell:)]) {
                [self.delegate armourEarCatView:self willDisplayCell:headFitView];
            }
            
            
            [self.ampereBitmap addObject:headFitView];
            
            [headFitView sharingOfferStaleGermanBox:^{
                
                
                [headFitView setTransform:CGAffineTransformMakeTranslation(- headFitView.frame.size.width-EarLockingOpt, 0)];
                
            } completion:^(BOOL finished) {
                
                [headFitView removeFromSuperview];
                
                
                [self.ampereBitmap removeObject:headFitView];
                
                
                if ([self.delegate respondsToSelector:@selector(armourEarCatView:didEndDisplayingCell:)]) {
                    [self.delegate armourEarCatView:self didEndDisplayingCell:headFitView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(responseMobileWetMapBufferedExtrinsicRetainInuit:)]) {
                        [self.delegate responseMobileWetMapBufferedExtrinsicRetainInuit:self];
                    }
                    self.count = 0;
                }
                
                

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


- (void)pinkFileSoccer:(NSArray <RealHexSubLessCell *> *)barrages
{
    self.count += barrages.count;
    [self.drumArray addObjectsFromArray:barrages];
}

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

- (void)stop
{
    if (self.status == MeteringNauticalAggregateEditorHierarchyStrip) {
        return;
    }
    self.status = MeteringNauticalAggregateEditorHierarchyStrip;
    
    if (self.ampereBitmap.count) {
        [self.ampereBitmap makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.drumArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.ampereBitmap  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.ampereBitmap  removeAllObjects];
    [self.drumArray     removeAllObjects];
    [self.editFunArray  removeAllObjects];
    
    self.ampereBitmap       = nil;
    self.drumArray          = nil;
    self.editFunArray       = nil;
}


- (NSInteger)millionStarSuccessSuggestedZeroFaceVolumes:(RealHexSubLessCell *)newBarrage
{
    for (int row = 0; row<_editFunArray.count; row++) {
        NSObject *object = _editFunArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[RealHexSubLessCell class]]) { 
            
            RealHexSubLessCell *logBarFood = (RealHexSubLessCell*)object;
            
            if ([self millionStarSuccessSuggestedZeroFaceVolumes:logBarFood sendLoose:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)millionStarSuccessSuggestedZeroFaceVolumes:(RealHexSubLessCell *)logBarFood sendLoose:(RealHexSubLessCell *)newBarrage
{
    
    if (logBarFood.status == TelephotoEggKilowattDistantStaleDensity) {
        return NO;
    }
    
    
    CGRect rect = [logBarFood.layer.presentationLayer frame];
    if (rect.origin.x>EarLockingOpt - logBarFood.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (logBarFood.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = EarLockingOpt/(EarLockingOpt+newBarrage.frame.size.width)*newBarrage.edgaAudioKit;
        
        CGFloat deny = rect.origin.x - time/(logBarFood.edgaAudioKit)*(EarLockingOpt + logBarFood.frame.size.width);
        if (deny < -logBarFood.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *early = [touches anyObject];
    CGPoint tallBigSex  = [early locationInView:self];
    for (UIView *fatFoot in [self subviews])
    {
        if (![fatFoot isKindOfClass:[RealHexSubLessCell class]]) continue;
        RealHexSubLessCell *headFitView = (RealHexSubLessCell *)fatFoot;
        if ([headFitView.layer.presentationLayer hitTest:tallBigSex])
        {
            
            if ([self.delegate respondsToSelector:@selector(armourEarCatView:markFlatHowCell:)]) {
                [self.delegate armourEarCatView:self markFlatHowCell:headFitView];
            }
            break;
        }
    }
}




- (NSMutableArray<RealHexSubLessCell *> *)drumArray {
    if (!_drumArray) {
        _drumArray = [[NSMutableArray alloc] init];
    }
    return _drumArray;
}


- (NSMutableArray<RealHexSubLessCell *> *)ampereBitmap {
    if (!_ampereBitmap) {
        _ampereBitmap = [[NSMutableArray alloc] init];
    }
    return _ampereBitmap;
}


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


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

@end
