2026-04-03 16:56:47 +08:00
|
|
|
|
import '../../../features/divination/data/models/divination_params.dart';
|
2026-04-08 17:23:02 +08:00
|
|
|
|
import '../../../l10n/app_localizations.dart';
|
2026-04-03 16:56:47 +08:00
|
|
|
|
|
|
|
|
|
|
abstract final class DivinationTerms {
|
|
|
|
|
|
static const yaoNames = ['初爻', '二爻', '三爻', '四爻', '五爻', '上爻'];
|
|
|
|
|
|
|
|
|
|
|
|
static const yaoTypeLabels = {
|
|
|
|
|
|
YaoTypeLabel.youngYang: '少阳',
|
|
|
|
|
|
YaoTypeLabel.youngYin: '少阴',
|
|
|
|
|
|
YaoTypeLabel.oldYang: '老阳',
|
|
|
|
|
|
YaoTypeLabel.oldYin: '老阴',
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const yinYang = {true: '阳', false: '阴'};
|
|
|
|
|
|
|
2026-04-07 18:41:08 +08:00
|
|
|
|
static const ziHua = {true: '字', false: '花'};
|
|
|
|
|
|
|
2026-04-03 16:56:47 +08:00
|
|
|
|
static const wuXing = ['木', '火', '土', '金', '水'];
|
|
|
|
|
|
|
|
|
|
|
|
static const yuanZhi = '元';
|
|
|
|
|
|
|
|
|
|
|
|
static const changeMarkOldYang = '○';
|
|
|
|
|
|
static const changeMarkOldYin = '×';
|
|
|
|
|
|
|
2026-04-03 19:04:46 +08:00
|
|
|
|
static const yinYangSymbol = {true: '—', false: '--'};
|
|
|
|
|
|
static const youngYangSymbol = '—';
|
|
|
|
|
|
static const youngYinSymbol = '--';
|
|
|
|
|
|
static const oldYangSymbol = '—○';
|
|
|
|
|
|
static const oldYinSymbol = '--×';
|
|
|
|
|
|
|
2026-04-03 16:56:47 +08:00
|
|
|
|
static const signBest = '上上签';
|
|
|
|
|
|
static const signGood = '中上签';
|
|
|
|
|
|
static const signNormal = '中下签';
|
2026-04-06 01:28:10 +08:00
|
|
|
|
static const signWorst = '下下签';
|
2026-04-03 16:56:47 +08:00
|
|
|
|
|
|
|
|
|
|
static const ganZhi = '干支';
|
|
|
|
|
|
static const ganZhiInfo = '干支信息';
|
|
|
|
|
|
static const ganZhiKongWang = '干支空亡';
|
|
|
|
|
|
static const yueJian = '月建';
|
|
|
|
|
|
static const riChen = '日辰';
|
|
|
|
|
|
static const yuePo = '月破';
|
|
|
|
|
|
static const riChong = '日冲';
|
|
|
|
|
|
static const wuXingWangShuai = '五行旺衰';
|
|
|
|
|
|
|
|
|
|
|
|
static const guaXiang = '卦象';
|
|
|
|
|
|
static const yaoXiang = '爻象';
|
|
|
|
|
|
static const qiGua = '起卦';
|
|
|
|
|
|
static const jieGua = '解卦';
|
2026-04-08 17:23:02 +08:00
|
|
|
|
|
|
|
|
|
|
static String yaoName(AppLocalizations l10n, int index) {
|
|
|
|
|
|
return switch (index) {
|
|
|
|
|
|
0 => l10n.yaoNameFirst,
|
|
|
|
|
|
1 => l10n.yaoNameSecond,
|
|
|
|
|
|
2 => l10n.yaoNameThird,
|
|
|
|
|
|
3 => l10n.yaoNameFourth,
|
|
|
|
|
|
4 => l10n.yaoNameFifth,
|
|
|
|
|
|
5 => l10n.yaoNameTop,
|
|
|
|
|
|
_ => '',
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static String yinYangLabel(AppLocalizations l10n, bool isYang) {
|
|
|
|
|
|
return isYang ? l10n.yaoYang : l10n.yaoYin;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static String yaoTypeLabel(AppLocalizations l10n, YaoType type) {
|
|
|
|
|
|
return switch (type) {
|
|
|
|
|
|
YaoType.youngYang => l10n.yaoYoungYang,
|
|
|
|
|
|
YaoType.youngYin => l10n.yaoYoungYin,
|
|
|
|
|
|
YaoType.oldYang => l10n.yaoOldYang,
|
|
|
|
|
|
YaoType.oldYin => l10n.yaoOldYin,
|
|
|
|
|
|
YaoType.undetermined => '',
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
2026-04-03 16:56:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum YaoTypeLabel { youngYang, youngYin, oldYang, oldYin }
|
|
|
|
|
|
|
|
|
|
|
|
extension YaoTypeLabelX on YaoType {
|
|
|
|
|
|
String get label {
|
|
|
|
|
|
return switch (this) {
|
|
|
|
|
|
YaoType.youngYang =>
|
|
|
|
|
|
DivinationTerms.yaoTypeLabels[YaoTypeLabel.youngYang]!,
|
|
|
|
|
|
YaoType.youngYin => DivinationTerms.yaoTypeLabels[YaoTypeLabel.youngYin]!,
|
|
|
|
|
|
YaoType.oldYang => DivinationTerms.yaoTypeLabels[YaoTypeLabel.oldYang]!,
|
|
|
|
|
|
YaoType.oldYin => DivinationTerms.yaoTypeLabels[YaoTypeLabel.oldYin]!,
|
|
|
|
|
|
YaoType.undetermined => '',
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String get changeMark {
|
|
|
|
|
|
return switch (this) {
|
|
|
|
|
|
YaoType.oldYang => DivinationTerms.changeMarkOldYang,
|
|
|
|
|
|
YaoType.oldYin => DivinationTerms.changeMarkOldYin,
|
|
|
|
|
|
_ => '',
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool get isYang {
|
|
|
|
|
|
return switch (this) {
|
|
|
|
|
|
YaoType.youngYang || YaoType.oldYang => true,
|
|
|
|
|
|
_ => false,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|