Merge pull request #6 from LeRoid-hub/1-custom-data-structure-or-generic-for-bundesland

data structure bl
This commit is contained in:
LeRoid-hub 2023-12-23 21:37:09 +01:00 committed by GitHub
commit 519b9ea6cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;