








#import "InferiorsDraft.h"

#define VideoOutFoggy self.frame.size.width

@interface InferiorsDraft()



@property (nonatomic, strong) NSMutableArray                            *bankEraArray;



@property (nonatomic, strong) NSMutableArray <WhoBandLockHueCell *>      *awayArray;



@property (strong, nonatomic) NSMutableArray <WhoBandLockHueCell *>      *adoptPartner;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) ExtraBiotinKilobitsAllStorage                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   endNot;

@end

@implementation InferiorsDraft

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

- (void)pubMagicWarn
{
    
    if (self.awayArray.firstObject) {
        
        
        WhoBandLockHueCell *itsEchoView = self.awayArray.firstObject;
        
        itsEchoView.frame = CGRectMake(VideoOutFoggy, 0, itsEchoView.penFootSize.width, itsEchoView.penFootSize.height);
        
        self.endNot = itsEchoView.endNot;
        
        self.channelCount = itsEchoView.channelCount;
        
        
        NSInteger row = [self oddButBodyEnableTagPoolExchanges:itsEchoView];
        
        
        if (row >= 0) {
            
            
            [self.awayArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:itsEchoView]) {
                [self addSubview:itsEchoView];
            }
            itsEchoView.frame = CGRectMake(VideoOutFoggy,  row * (itsEchoView.penFootSize.height + _endNot), itsEchoView.penFootSize.width, itsEchoView.penFootSize.height);
            
            
            [_bankEraArray setObject:itsEchoView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(rollProxySexView:willDisplayCell:)]) {
                [self.delegate rollProxySexView:self willDisplayCell:itsEchoView];
            }
            
            
            [self.adoptPartner addObject:itsEchoView];
            
            [itsEchoView annotatedLiveQualifiedAdjectiveSerbian:^{
                
                
                [itsEchoView setTransform:CGAffineTransformMakeTranslation(- itsEchoView.frame.size.width-VideoOutFoggy, 0)];
                
            } completion:^(BOOL finished) {
                
                [itsEchoView removeFromSuperview];
                
                
                [self.adoptPartner removeObject:itsEchoView];
                
                
                if ([self.delegate respondsToSelector:@selector(rollProxySexView:didEndDisplayingCell:)]) {
                    [self.delegate rollProxySexView:self didEndDisplayingCell:itsEchoView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(dateDiscountsRecoveryJobStrideLowerInfoSpeaker:)]) {
                        [self.delegate dateDiscountsRecoveryJobStrideLowerInfoSpeaker:self];
                    }
                    self.count = 0;
                }
                
                

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


- (void)sexFaceNetFour:(NSArray <WhoBandLockHueCell *> *)barrages
{
    self.count += barrages.count;
    [self.awayArray addObjectsFromArray:barrages];
}

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

- (void)stop
{
    if (self.status == ScrollingActionSigmoidChainPrepExponent) {
        return;
    }
    self.status = ScrollingActionSigmoidChainPrepExponent;
    
    if (self.adoptPartner.count) {
        [self.adoptPartner makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.awayArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.adoptPartner  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.adoptPartner  removeAllObjects];
    [self.awayArray     removeAllObjects];
    [self.bankEraArray  removeAllObjects];
    
    self.adoptPartner       = nil;
    self.awayArray          = nil;
    self.bankEraArray       = nil;
}


- (NSInteger)oddButBodyEnableTagPoolExchanges:(WhoBandLockHueCell *)newBarrage
{
    for (int row = 0; row<_bankEraArray.count; row++) {
        NSObject *object = _bankEraArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[WhoBandLockHueCell class]]) { 
            
            WhoBandLockHueCell *eightDrain = (WhoBandLockHueCell*)object;
            
            if ([self oddButBodyEnableTagPoolExchanges:eightDrain crossHold:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)oddButBodyEnableTagPoolExchanges:(WhoBandLockHueCell *)eightDrain crossHold:(WhoBandLockHueCell *)newBarrage
{
    
    if (eightDrain.status == DeepLateTraitMagicSampleEnable) {
        return NO;
    }
    
    
    CGRect rect = [eightDrain.layer.presentationLayer frame];
    if (rect.origin.x>VideoOutFoggy - eightDrain.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (eightDrain.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = VideoOutFoggy/(VideoOutFoggy+newBarrage.frame.size.width)*newBarrage.barRawEither;
        
        CGFloat gram = rect.origin.x - time/(eightDrain.barRawEither)*(VideoOutFoggy + eightDrain.frame.size.width);
        if (gram < -eightDrain.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *farsi = [touches anyObject];
    CGPoint executeOur  = [farsi locationInView:self];
    for (WhoBandLockHueCell *itsEchoView in [self subviews])
    {
        if ([itsEchoView.layer.presentationLayer hitTest:executeOur])
        {
            
            if ([self.delegate respondsToSelector:@selector(rollProxySexView:lawObservedCell:)]) {
                [self.delegate rollProxySexView:self lawObservedCell:itsEchoView];
            }
            break;
        }
    }
}




- (NSMutableArray<WhoBandLockHueCell *> *)awayArray {
    if (!_awayArray) {
        _awayArray = [[NSMutableArray alloc] init];
    }
    return _awayArray;
}


- (NSMutableArray<WhoBandLockHueCell *> *)adoptPartner {
    if (!_adoptPartner) {
        _adoptPartner = [[NSMutableArray alloc] init];
    }
    return _adoptPartner;
}


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


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

@end
