mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
25 lines
631 B
JavaScript
25 lines
631 B
JavaScript
const path = require('path');
|
|
|
|
module.exports = class TarotCard {
|
|
constructor(data) {
|
|
this.rank = data.rank;
|
|
this.suit = data.suit;
|
|
this.name = data.name;
|
|
this.meanings = data.meanings;
|
|
this.keywords = data.keywords;
|
|
this.fortunes = data.fortune_telling;
|
|
}
|
|
|
|
get imagePath() {
|
|
return path.join(__dirname, '..', '..', 'assets', 'images', 'tarot', this.suit, `${this.rank}.jpg`);
|
|
}
|
|
|
|
randomLightMeaning() {
|
|
return this.meanings.light[Math.floor(Math.random() * this.meanings.light.length)];
|
|
}
|
|
|
|
randomShadowMeaning() {
|
|
return this.meanings.shadow[Math.floor(Math.random() * this.meanings.shadow.length)];
|
|
}
|
|
};
|