mirror of
https://github.com/LeRoid-hub/Mensa-API.git
synced 2025-01-31 11:44:55 +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 {
|
class Campus {
|
||||||
name: string;
|
name: string;
|
||||||
mensen: Mensa[];
|
locations: Mensa[];
|
||||||
|
|
||||||
constructor(name: string) {
|
constructor(name: string) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.mensen = [];
|
this.locations = [];
|
||||||
}
|
}
|
||||||
addMensa(mensa: Mensa) {
|
addMensa(mensa: Mensa) {
|
||||||
this.mensen.push(mensa);
|
this.locations.push(mensa);
|
||||||
}
|
}
|
||||||
toString() {
|
toString() {
|
||||||
let str = this.name + "\n";
|
let str = this.name + "\n";
|
||||||
this.mensen.forEach((elem) => {
|
this.locations.forEach((elem) => {
|
||||||
str += " -> " + elem.name + " | " + elem.url + "\n";
|
str += " -> " + elem.name + " | " + elem.url + "\n";
|
||||||
});
|
});
|
||||||
return str;
|
return str;
|
||||||
|
Loading…
Reference in New Issue
Block a user