igir
Version:
🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.
30 lines (29 loc) • 742 B
JavaScript
/**
* A container of {@link Game}s that are all related together by parent/clone {@link DAT} info.
*/
export default class Parent {
parentGame;
allGames;
constructor(parentGame, allGames) {
this.parentGame = parentGame;
if (allGames === undefined) {
this.allGames = [parentGame];
}
else {
this.allGames = Array.isArray(allGames) ? allGames : [allGames];
}
}
// Property getters
getName() {
return this.parentGame.getName();
}
getGames() {
return this.allGames;
}
/**
* Add a child {@link Game} to this {@link Parent}'s list of {@link Game}s.
*/
addChild(child) {
this.allGames.push(child);
}
}