//
//  LCObjectsTimelineProperty.h
//  LogoistCore
//
//  Created by Mendel Kucharzeck on 19.08.12.
//  Copyright (c) 2012 AvisNocturna Software. All rights reserved.
//

@class LCBaseObject;
@class LCObjectsTimelinePropertyChange;
@class LCObjectsTimelineManager;
@class LCTimelineAnimateableObject;

@interface LCObjectsTimelineProperty : NSObject <NSCoding>
{
    LCObjectsTimelineManager *timelineManager;
    
    LCTimelineAnimateableObject *object;
    NSString *propertyName;
    
    NSMutableArray *changes;
}

- (id) initWithObject:(LCTimelineAnimateableObject*)o andPropertyName:(NSString*)p andTimelinePropertyManager:(LCObjectsTimelineManager*)m;

@property (readonly) LCObjectsTimelineManager *timelineManager;
@property (readonly) LCTimelineAnimateableObject *object;
@property (readonly) NSString *propertyName;

@property (copy) NSArray *changes;
@property (readonly) NSArray *sortedChanges;

- (void) addChange:(LCObjectsTimelinePropertyChange*)change;
- (void) removeChange:(LCObjectsTimelinePropertyChange*)change;
- (NSArray*) findTimelinePropertyChangesForTimeWithDefaultThreshold:(float)time;
- (NSArray*) findTimelinePropertyChangesForTime:(float)time withTimeThreshold:(float)threshold;
- (LCObjectsTimelinePropertyChange*) findClosestTimelinePropertyChangeForTime:(float)time withThreshold:(float)threshold;
- (LCObjectsTimelinePropertyChange*) findClosestTimelinePropertyChangeForTimeWithDefaultThreshold:(float)time;

- (LCObjectsTimelinePropertyChange*) findOrCreateTimelinePropertyChangeForTimeWithDefaultThreshold:(float)time;
- (LCObjectsTimelinePropertyChange*) findOrCreateTimelinePropertyChangeForTime:(float)time withTimeThreshold:(float)threshold;

- (float) earliestPropertyChangeTime;
- (float) latestPropertyChangeTime;

@end
