/***
 * Excerpted from "Developing for Apple Watch",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/jkwatch for more book information.
***/
//
//  Run.h
//  tapalap
//
//  Created by Jeff Kelley on 2/27/15.
//  Copyright (c) 2015 Pragmatic Bookshelf. All rights reserved.
//


#import <Foundation/Foundation.h>

@interface Run : NSObject

@property (strong) NSDate *startDate;

@property (readonly, nonatomic) NSTimeInterval duration;
@property (assign) double distance; // In meters

/// An array of @c NSTimeInterval values wrapped up as @c NSNumber instances.
@property (strong) NSArray *laps;

@property (readonly, nonatomic) NSTimeInterval pace;

+ (instancetype)runWithDictionary:(NSDictionary *)dictionary;

- (instancetype)initWithStartDate:(NSDate *)startDate
                             laps:(NSArray *)laps
                         distance:(double)distance;

- (NSDictionary *)dictionaryRepresentation;

@end
