//
//  PersonScoreModel.m
//  gaotingshan
//
//  Created by Mac Book DQ02 on 16/5/26.
//  Copyright © 2016年 Xu Mengzhu. All rights reserved.
//

#import "PersonScoreModel.h"

@implementation PersonScoreModel

- (id)initWithInforDic:(NSDictionary *)inforDic {
    if (self = [super init]) {
        self.userId = [inforDic objectForKey:@"userId"];
        self.repeaterName = inforDic[@"repeaterName"];
        self.userName = inforDic[@"userName"];
        
        NSNumber *eventTime = inforDic[@"eventTime"];
        //如果排名为空，给它赋一个大值，便于排序
        self.eventSeconds = eventTime;
        
        self.sportTime = [inforDic objectForKey:@"sportTime"];
        
        NSNumber *mileage = [inforDic objectForKey:@"mileage"];
        NSNumber *sportRemoving = [inforDic objectForKey:@"sportRemoving"];
        float restMeter= [mileage floatValue] - [sportRemoving floatValue];
        NSString *restMeters = [NSString stringWithFormat:@"%.2f",restMeter];
        self.restMeters = restMeters;
        self.pointX = [inforDic objectForKey:@"axis_x"];
        self.pointY = [inforDic objectForKey:@"axis_y"];
        
    }
    return self;
}


#pragma mark - KVC
//使用KVC赋值, 没有找到对应的key
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    //NSLog(@"不能识别%@", key);
    
}

//使用KVC取值, 没有找到对应的key
- (id)valueForUndefinedKey:(NSString *)key {
    //NSLog(@"不能识别%@", key);
    return nil;
}

@end
