import { TIANJI_DICTIONARY } from './tianji-dictionary'; import { BONUS_RULES, PENALTY_RULES, CONFLICT_RESOLUTION, ScoreRule } from './scoring-tables'; export interface AdviceItem { rule: string; content: string; } export interface ConflictRuleDef { priority: number; name: string; condition: (hasLu: boolean, hasJi: boolean, hasGoodPattern?: boolean, hasBadInteraction?: boolean) => boolean; action: string; } export interface IKnowledgeSource { getPatternAdvices(): Record; getSihuaAdvices(): Record; getStarsAdvices(): Record; getGeneralAdvices(): Record; getBonusRules(): Record; getPenaltyRules(): Record; getConflictRules(): ConflictRuleDef[]; } export class LocalKnowledgeSource implements IKnowledgeSource { getPatternAdvices() { return TIANJI_DICTIONARY.patterns; } getSihuaAdvices() { return TIANJI_DICTIONARY.sihua; } getStarsAdvices() { return TIANJI_DICTIONARY.stars; } getGeneralAdvices() { return TIANJI_DICTIONARY.general; } getBonusRules() { return BONUS_RULES; } getPenaltyRules() { return PENALTY_RULES; } getConflictRules() { return CONFLICT_RESOLUTION; } } export const knowledgeSource = new LocalKnowledgeSource();