fix: build errors and merge in Casey's branch (driodiwb)

This commit is contained in:
knownotunknown
2024-02-19 12:03:23 -06:00
committed by doprz
parent 8df9ea55a9
commit 39947b3694
16 changed files with 597 additions and 151 deletions

View File

@@ -14,6 +14,7 @@ export const UserScheduleStore = createLocalStore<IUserScheduleStore>({
new UserSchedule({
courses: [],
name: 'Schedule 1',
hours: 0,
}),
],
activeIndex: 0,

View File

@@ -7,13 +7,18 @@ import { Course } from './Course';
export class UserSchedule {
courses: Course[];
name: string;
hours: number;
constructor(schedule: Serialized<UserSchedule>) {
this.courses = schedule.courses.map(c => new Course(c));
this.name = schedule.name;
this.hours = 0;
for (const course of this.courses) {
this.hours += course.creditHours;
}
}
containsCourse(course: Course): boolean {
return this.courses.some(c => c.uniqueId === course.uniqueId);
}
}
}