data structure bl

This commit is contained in:
Jan Barfuss 2023-12-23 21:36:34 +01:00
parent 1ee58fa90d
commit 2a8f5635dc

View File

@ -2,18 +2,18 @@ import * as cheerio from 'cheerio';
class Campus {
name: string;
mensen: Mensa[];
locations: Mensa[];
constructor(name: string) {
this.name = name;
this.mensen = [];
this.locations = [];
}
addMensa(mensa: Mensa) {
this.mensen.push(mensa);
this.locations.push(mensa);
}
toString() {
let str = this.name + "\n";
this.mensen.forEach((elem) => {
this.locations.forEach((elem) => {
str += " -> " + elem.name + " | " + elem.url + "\n";
});
return str;