Add profiles

This commit is contained in:
Wessel Tip
2019-07-08 13:05:13 +02:00
parent c91ed60ae4
commit f1ec45d913
2 changed files with 48 additions and 7 deletions

21
lib/util/Collection.js Normal file
View File

@@ -0,0 +1,21 @@
module.exports = class PikminCollection extends Map {
constructor() {
super();
}
filter(callback) {
let result = [];
for (const entry of Array.from(this.values())) {
if (callback(entry)) result.push(entry);
}
return result;
}
map(callback) {
let result = [];
for (const value of Array.from(this.values())) result.push(callback(value));
return result;
}
};