// // CourseModel.m // tongxin // // Created by ecell on 2021/11/24. // Copyright © 2021 xTT. All rights reserved. // #import "CourseModel.h" @implementation CourseModel + (instancetype)courseWithName:(NSString *)name dayIndex:(NSUInteger)dayIndex startCourseIndex:(NSUInteger)startCourseIndex endCourseIndex:(NSUInteger)endCourseIndex{ CourseModel *model = [[self alloc] init]; model.courseName = name; model.dayIndex = dayIndex; model.startCourseIndex = startCourseIndex; model.endCourseIndex = endCourseIndex; model.sortIndex = 0; return model; } + (instancetype)courseWithName:(NSString *)name nameAttribute:(NSDictionary *)nameAttribute dayIndex:(NSUInteger)dayIndex startCourseIndex:(NSUInteger)startCourseIndex endCourseIndex:(NSUInteger)endCourseIndex{ CourseModel *model = [CourseModel courseWithName:name dayIndex:dayIndex startCourseIndex:startCourseIndex endCourseIndex:endCourseIndex]; model.nameAttribute = nameAttribute; return model; } - (BOOL)isSameCourse:(CourseModel *)course { return _dayIndex == course.dayIndex && _startCourseIndex == course.startCourseIndex; } @end