mpp-server-dev2/oldsrc/Cow.js

30 lines
560 B
JavaScript
Raw Normal View History

2023-03-31 16:43:24 +02:00
const ung = require("unique-names-generator");
2022-08-16 12:23:21 +02:00
const ung_config = {
2023-03-31 16:43:24 +02:00
dictionaries: [ung.names],
separator: " ",
length: 1
};
2022-08-16 12:23:21 +02:00
class Cow {
static generateRandomName() {
return ung.uniqueNamesGenerator(ung_config);
}
constructor() {
2023-03-31 16:43:24 +02:00
this["display_name"] = Cow.generateRandomName();
this["emoji"] = "🐄";
this["count"] = 1;
}
toString() {
return `${this.emoji}${this.display_name}${
this.count > 1 ? `(x${this.count})` : ""
}`;
2022-08-16 12:23:21 +02:00
}
}
module.exports = {
Cow
2023-03-31 16:43:24 +02:00
};