diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-09-14 17:34:14 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-09-14 17:35:34 +0200 |
| commit | 9876d989b52528574861ef44409a5b680e542340 (patch) | |
| tree | 763f0517114edbee346bf49b4f4e640b99d2cc21 /src/group.ts | |
| parent | d18d5f869d57d31c987b4b7fe0c7feae9aba8b2e (diff) | |
| download | bycs-sol-9876d989b52528574861ef44409a5b680e542340.tar.gz bycs-sol-9876d989b52528574861ef44409a5b680e542340.zip | |
remove groups
Diffstat (limited to 'src/group.ts')
| -rw-r--r-- | src/group.ts | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/group.ts b/src/group.ts deleted file mode 100644 index e840ffd..0000000 --- a/src/group.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { Student } from "./student-common.ts"; - -/** - * Class to represent a Group of Students. - */ -class Group { - name: string; - students: Array<Student> = []; - - constructor(name: string, students?: Array<Student>) { - this.name = name; - if (typeof students !== "undefined") { - this.students = students; - } - } - - setStudents(students: Array<Student>) { - this.students = students; - } - - addStudent(student: Student) { - this.students.push(student); - } - - async getStudents() { - return this.students; - } -} - -const groups = new Map(); - -function buildGroups(students: Array<Student>) { - for (const student of students) { - let group = groups.get(student.group); - - if (!group) { - group = new Group(student.group); - groups.set(student.group, group); - } - - group.addStudent(student); - } -} - -export { Group, buildGroups, groups as _groups }; |
