You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.3 KiB

//
// 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