Esempio n. 1
0
        public static 五行 化(this 地支 支, 地支 合)
        {
            switch (支)
            {
            case 子 _ when 合 is 丑:
                return(五行.土);   // 子丑合化土

            case 寅 _ when 合 is 亥:
                return(五行.木);   // 寅亥合化木

            case 卯 _ when 合 is:
                return(五行.火);   // 卯戌合化火

            case 辰 _ when 合 is 酉:
                return(五行.金);   // 辰酉合化金

            case 巳 _ when 合 is 申:
                return(五行.水);   // 巳申合化水

            case 午 _ when 合 is 未:
                return(五行.土);   // 午未合化土

            default:
                throw new Exception($"未找到正确的合化五行,当前地支[{支}],合[{合}]");
            }
        }
Esempio n. 2
0
        public 甲子(天干 干, 地支 支)
        {
            var 枚举名 = 干.称 + 支.称;
            var 枚   = 枚举转换类 <甲子枚举> .获取枚举(枚举名);

            初始化(枚);
        }
Esempio n. 3
0
        public static 长生枚举 长生查询(天干 干, 地支 支)
        {
            var 干枚 = 干支表.获取天干枚举(干.称);
            var 支枚 = 干支表.获取地支枚举(支.称);

            return(长生查询(干枚, 支枚));
        }
Esempio n. 4
0
        public static 天干 五鼠遁(this 天干 干, 地支 支)
        {
            var 起遁 = 干.五鼠遁();
            var 遁序 = 干支表.获取天干序数(起遁);
            var 支序 = 干支表.获取地支序数(支);
            var 干序 = (遁序 + 支序) % 10;

            return(干支表.天干查询(干序));
        }
Esempio n. 5
0
        public static 神煞 日支时辰算神煞(地支 日支, 地支 时辰)
        {
            var 日序  = 干支表.获取地支序数(日支);
            var 时序  = 干支表.获取地支序数(时辰);
            var 起序表 = new int[] { 8, 10, 0, 2, 4, 6 };
            var 起序  = 起序表[日序 % 6];
            var 神煞序 = 干支表.地支数 - 起序 + 时序;

            return(new 神煞(神煞序));
        }
Esempio n. 6
0
        public static 地支 合(this 地支 支)
        {
            // 子丑合化土,寅亥合化木,卯戌合化火,辰酉合化金,巳申合化水,午未合化土。
            switch (支)
            {
            case 子 _:
                return(地支.丑);

            case 寅 _:
                return(地支.亥);

            case 卯 _:
                return(地支.);

            case 辰 _:
                return(地支.酉);

            case 巳 _:
                return(地支.申);

            case 午 _:
                return(地支.未);

            case 丑 _:
                return(地支.子);

            case 亥 _:
                return(地支.寅);

            case   _:
                return(地支.卯);

            case 酉 _:
                return(地支.辰);

            case 申 _:
                return(地支.巳);

            case 未 _:
                return(地支.午);

            default:
                throw new Exception($"未找到正确的合化地支,当前地支[{支}]");
            }
        }
Esempio n. 7
0
        public static 八卦 地支配卦(this 地支 支)
        {
            switch (支)
            {
            case 子 _:
                return(八卦.坎);

            case 丑 _:
                return(八卦.艮);

            case 寅 _:
                return(八卦.艮);

            case 卯 _:
                return(八卦.震);

            case 辰 _:
                return(八卦.巽);

            case 巳 _:
                return(八卦.巽);

            case 午 _:
                return(八卦.离);

            case 未 _:
                return(八卦.坤);

            case 申 _:
                return(八卦.坤);

            case 酉 _:
                return(八卦.兑);

            case   _:
                return(八卦.乾);

            case 亥 _:
                return(八卦.乾);

            default:
                throw new Exception($"未找到匹配的地支,当前输入{支}");
            }
        }
Esempio n. 8
0
        public static 长生枚举 地支长生(天干 干, 地支 支)
        {
            switch (干)
            {
            case 甲 _ when 支 is 亥:
            case 丙 _ when 支 is 寅:
            case   _ when 支 is 寅:
            case 庚 _ when 支 is 巳:
            case 壬 _ when 支 is 申:
            case 乙 _ when 支 is 午:
            case 丁 _ when 支 is 酉:
            case 己 _ when 支 is 酉:
            case 辛 _ when 支 is 子:
            case 癸 _ when 支 is 卯:
                return(长生枚举.长生);

            case 甲 _ when 支 is 子:
            case 丙 _ when 支 is 卯:
            case   _ when 支 is 卯:
            case 庚 _ when 支 is 午:
            case 壬 _ when 支 is 酉:
            case 乙 _ when 支 is 巳:
            case 丁 _ when 支 is 申:
            case 己 _ when 支 is 申:
            case 辛 _ when 支 is 亥:
            case 癸 _ when 支 is 寅:
                return(长生枚举.沐浴);

            case 甲 _ when 支 is 丑:
            case 丙 _ when 支 is 辰:
            case   _ when 支 is 辰:
            case 庚 _ when 支 is 未:
            case 壬 _ when 支 is:
            case 乙 _ when 支 is 辰:
            case 丁 _ when 支 is 未:
            case 己 _ when 支 is 未:
            case 辛 _ when 支 is:
            case 癸 _ when 支 is 丑:
                return(长生枚举.冠带);

            case 甲 _ when 支 is 寅:
            case 丙 _ when 支 is 巳:
            case   _ when 支 is 巳:
            case 庚 _ when 支 is 申:
            case 壬 _ when 支 is 亥:
            case 乙 _ when 支 is 卯:
            case 丁 _ when 支 is 午:
            case 己 _ when 支 is 午:
            case 辛 _ when 支 is 酉:
            case 癸 _ when 支 is 子:
                return(长生枚举.临官);

            case 甲 _ when 支 is 卯:
            case 丙 _ when 支 is 午:
            case   _ when 支 is 午:
            case 庚 _ when 支 is 酉:
            case 壬 _ when 支 is 子:
            case 乙 _ when 支 is 寅:
            case 丁 _ when 支 is 巳:
            case 己 _ when 支 is 巳:
            case 辛 _ when 支 is 申:
            case 癸 _ when 支 is 亥:
                return(长生枚举.帝旺);

            case 甲 _ when 支 is 辰:
            case 丙 _ when 支 is 未:
            case   _ when 支 is 未:
            case 庚 _ when 支 is:
            case 壬 _ when 支 is 丑:
            case 乙 _ when 支 is 丑:
            case 丁 _ when 支 is 辰:
            case 己 _ when 支 is 辰:
            case 辛 _ when 支 is 未:
            case 癸 _ when 支 is:
                return(长生枚举.衰);

            case 甲 _ when 支 is 巳:
            case 丙 _ when 支 is 申:
            case   _ when 支 is 申:
            case 庚 _ when 支 is 亥:
            case 壬 _ when 支 is 寅:
            case 乙 _ when 支 is 子:
            case 丁 _ when 支 is 卯:
            case 己 _ when 支 is 卯:
            case 辛 _ when 支 is 午:
            case 癸 _ when 支 is 酉:
                return(长生枚举.病);

            case 甲 _ when 支 is 午:
            case 丙 _ when 支 is 酉:
            case   _ when 支 is 酉:
            case 庚 _ when 支 is 子:
            case 壬 _ when 支 is 卯:
            case 乙 _ when 支 is 亥:
            case 丁 _ when 支 is 寅:
            case 己 _ when 支 is 寅:
            case 辛 _ when 支 is 巳:
            case 癸 _ when 支 is 申:
                return(长生枚举.死);

            case 甲 _ when 支 is 未:
            case 丙 _ when 支 is:
            case   _ when 支 is:
            case 庚 _ when 支 is 丑:
            case 壬 _ when 支 is 辰:
            case 乙 _ when 支 is:
            case 丁 _ when 支 is 丑:
            case 己 _ when 支 is 丑:
            case 辛 _ when 支 is 辰:
            case 癸 _ when 支 is 未:
                return(长生枚举.墓);

            case 甲 _ when 支 is 申:
            case 丙 _ when 支 is 亥:
            case   _ when 支 is 亥:
            case 庚 _ when 支 is 寅:
            case 壬 _ when 支 is 巳:
            case 乙 _ when 支 is 酉:
            case 丁 _ when 支 is 子:
            case 己 _ when 支 is 子:
            case 辛 _ when 支 is 卯:
            case 癸 _ when 支 is 午:
                return(长生枚举.绝);

            case 甲 _ when 支 is 酉:
            case 丙 _ when 支 is 子:
            case   _ when 支 is 子:
            case 庚 _ when 支 is 卯:
            case 壬 _ when 支 is 午:
            case 乙 _ when 支 is 申:
            case 丁 _ when 支 is 亥:
            case 己 _ when 支 is 亥:
            case 辛 _ when 支 is 寅:
            case 癸 _ when 支 is 巳:
                return(长生枚举.胎);

            case 甲 _ when 支 is:
            case 丙 _ when 支 is 丑:
            case   _ when 支 is 丑:
            case 庚 _ when 支 is 辰:
            case 壬 _ when 支 is 未:
            case 乙 _ when 支 is 未:
            case 丁 _ when 支 is:
            case 己 _ when 支 is:
            case 辛 _ when 支 is 丑:
            case 癸 _ when 支 is 辰:
                return(长生枚举.养);

            default:
                throw new Exception($"未找到地支匹配的长生,当前天干[{干}],当前地支[{支}]");
            }
        }
Esempio n. 9
0
 public static 长生枚举 在地支的长生(this 天干 干, 地支 支) => 地支长生(干, 支);
Esempio n. 10
0
        public static 地支 月支查月破(地支 月支)
        {
            var 序数 = 干支表.获取地支序数(月支);

            return(干支表.地支查询(序数 + 6));
        }
Esempio n. 11
0
        public 地支藏干(地支 支)
        {
            天干 本 = null, 中 = null, 余 = null;

            switch (支)
            {
            case 子 _:
                本  = 天干.癸;
                藏干 = new 天干[] { 本 };
                break;

            case 丑 _:
                本  = 天干.己; 中 = 天干.辛; 余 = 天干.癸;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 寅 _:
                本  = 天干.甲; 中 = 天干.丙; 余 = 天干.;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 卯 _:
                本  = 天干.乙;
                藏干 = new 天干[] { 本 };
                break;

            case 辰 _:
                本  = 天干.; 中 = 天干.癸; 余 = 天干.乙;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 巳 _:
                本  = 天干.丙; 中 = 天干.庚; 余 = 天干.;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 午 _:
                本  = 天干.丁; 中 = 天干.己;
                藏干 = new 天干[] { 本, 中 };
                break;

            case 未 _:
                本  = 天干.己; 中 = 天干.乙; 余 = 天干.丁;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 申 _:
                本  = 天干.庚; 中 = 天干.壬; 余 = 天干.;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 酉 _:
                本  = 天干.辛;
                藏干 = new 天干[] { 本 };
                break;

            case   _:
                本  = 天干.; 中 = 天干.丁; 余 = 天干.辛;
                藏干 = new 天干[] { 本, 中, 余 };
                break;

            case 亥 _:
                本  = 天干.壬; 中 = 天干.甲;
                藏干 = new 天干[] { 本, 中 };
                break;
            }
            本气 = 本?.称;
            中气 = 中?.称;
            余气 = 余?.称;
        }
Esempio n. 12
0
 public static 地支藏干 藏干(this 地支 支) => new 地支藏干(支);
Esempio n. 13
0
 public static bool 是三合火局(this 午 主, 地支 客一, 地支 客二) => 地支三合(new 地支[] { 主, 客一, 客二 }).Contains(五行.火);
Esempio n. 14
0
 public static bool 是三合金局(this 丑 主, 地支 客一, 地支 客二) => 地支三合(new 地支[] { 主, 客一, 客二 }).Contains(五行.金);
Esempio n. 15
0
 public static bool 是三合木局(this 未 主, 地支 客一, 地支 客二) => 地支三合(new 地支[] { 主, 客一, 客二 }).Contains(五行.木);
Esempio n. 16
0
 public static bool 是三合水局(this 辰 主, 地支 客一, 地支 客二) => 地支三合(new 地支[] { 主, 客一, 客二 }).Contains(五行.水);