mirror of
https://github.com/LeRoid-hub/Mensa-API.git
synced 2025-01-31 03:34:57 +00:00
data structure bl
This commit is contained in:
parent
1ee58fa90d
commit
2a8f5635dc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user