public static 长生枚举 长生查询(天干 干, 地支 支) { var 干枚 = 干支表.获取天干枚举(干.称); var 支枚 = 干支表.获取地支枚举(支.称); return(长生查询(干枚, 支枚)); }
public static 天干 五鼠遁(this 天干 干) { switch (干) { case 甲 _: case 己 _: return(天干.甲); // 甲己还加甲 case 乙 _: case 庚 _: return(天干.丙); // 乙庚丙作初 case 丙 _: case 辛 _: return(天干.); // 丙辛寻戊起 case 丁 _: case 壬 _: return(天干.庚); // 丁壬庚子居 case _: case 癸 _: return(天干.壬); // 戊癸何方发,壬子是真途 default: throw new Exception($"起遁失败,当前给定天干错误[{干}]"); } }
public 甲子(天干 干, 地支 支) { var 枚举名 = 干.称 + 支.称; var 枚 = 枚举转换类 <甲子枚举> .获取枚举(枚举名); 初始化(枚); }
public static 天干 五虎遁(this 天干 干) { switch (干) { case 甲 _: case 己 _: return(天干.丙); // 甲己之年丙作首 case 乙 _: case 庚 _: return(天干.); // 乙庚之岁戊为头 case 丙 _: case 辛 _: return(天干.庚); // 丙辛必定寻庚起 case 丁 _: case 壬 _: return(天干.壬); // 丁壬壬位顺水流 case _: case 癸 _: return(天干.甲); // 若问戊癸何处起,甲寅之上好追求 default: throw new Exception($"起遁失败,当前给定天干错误[{干}]"); } }
public 十神(天干 主, 天干 客) { var 性 = 主.阴阳 == 客.阴阳; var 主五行 = 主.五行; var 客五行 = 客.五行; if (主五行.生我() == 客五行) { 枚举 = 性 ? 十神枚举.偏印 : 十神枚举.正印; } if (主五行.我生() == 客五行) { 枚举 = 性 ? 十神枚举.食神 : 十神枚举.伤官; } if (主五行.克我() == 客五行) { 枚举 = 性 ? 十神枚举.偏官 : 十神枚举.正官; } if (主五行.我克() == 客五行) { 枚举 = 性 ? 十神枚举.偏财 : 十神枚举.正财; } if (主五行.我() == 客五行) { 枚举 = 性 ? 十神枚举.比肩 : 十神枚举.劫财; } 称 = 枚举转换类 <十神枚举> .获取名称(枚举); 简称 = 查询简称(枚举); }
static void 十神计算测试(天干 主, 天干 客, 十神枚举 测试枚举) { var 神 = new 十神(主, 客); Console.WriteLine($"主:{主.名称} 客:{客.名称} 名称:{神.名称} 简称:{神.简称}"); Console.WriteLine("----------"); Assert.IsTrue(神.枚举 == 测试枚举); }
public static 天干 五鼠遁(this 天干 干, 地支 支) { var 起遁 = 干.五鼠遁(); var 遁序 = 干支表.获取天干序数(起遁); var 支序 = 干支表.获取地支序数(支); var 干序 = (遁序 + 支序) % 10; return(干支表.天干查询(干序)); }
public static List <string> 的食神六亲(this 天干 主, 性别枚举 男女) { var 关系组 = new List <string>(); switch (男女) { case 性别枚举.男: 关系组.Add("女婿"); 关系组.Add("孙儿"); 关系组.Add("外公"); 关系组.Add("外甥"); break; case 性别枚举.女: 关系组.Add("祖母"); 关系组.Add("女儿"); 关系组.Add("外甥女"); break; } return(关系组); }
public static List <string> 的比肩六亲(this 天干 主, 性别枚举 男女) { var 关系组 = new List <string>(); switch (男女) { case 性别枚举.男: 关系组.Add("兄弟 "); 关系组.Add("姑丈"); 关系组.Add("堂兄弟"); 关系组.Add("姨表兄弟"); break; case 性别枚举.女: 关系组.Add("姐妹"); 关系组.Add("堂姐妹"); 关系组.Add("姨表姐妹"); break; } return(关系组); }
public static List <string> 的偏印六亲(this 天干 主, 性别枚举 男女) { var 关系组 = new List <string>(); switch (男女) { case 性别枚举.男: 关系组.Add("祖父"); 关系组.Add("外孙"); 关系组.Add("外父"); 关系组.Add("舅"); break; case 性别枚举.女: 关系组.Add("母亲"); 关系组.Add("孙女"); 关系组.Add("姨"); break; } return(关系组); }
public static 天干 合(this 天干 干) { // 甲己合化土,乙庚合化金,丙辛合化水,丁壬合化木,戊癸合化火 switch (干) { case 甲 _: return(天干.己); case 乙 _: return(天干.庚); case 丙 _: return(天干.辛); case 丁 _: return(天干.壬); case _: return(天干.癸); case 己 _: return(天干.甲); case 庚 _: return(天干.乙); case 辛 _: return(天干.丙); case 壬 _: return(天干.丁); case 癸 _: return(天干.); default: throw new Exception($"未找到正确的合化天干,当前天干[{干}]"); } }
public static 八卦 天干配卦(this 天干 干) { switch (干) { case 甲 _: return(八卦.乾); case 乙 _: return(八卦.坤); case 丙 _: return(八卦.艮); case 丁 _: return(八卦.兑); case _: return(八卦.坎); case 己 _: return(八卦.离); case 庚 _: return(八卦.震); case 辛 _: return(八卦.巽); case 壬 _: return(八卦.乾); case 癸 _: return(八卦.坤); default: throw new Exception($"未找到匹配的天干,当前输入{干}"); } }
public static List <string> 的正官六亲(this 天干 主, 性别枚举 男女) { var 关系组 = new List <string>(); switch (男女) { case 性别枚举.男: 关系组.Add("女儿"); 关系组.Add("侄女"); 关系组.Add("外婆"); 关系组.Add("姑表姐妹"); break; case 性别枚举.女: 关系组.Add("丈夫"); 关系组.Add("姐夫"); 关系组.Add("妹婿"); 关系组.Add("姑表兄弟"); 关系组.Add("小叔子"); break; } return(关系组); }
public static 五行 化(this 天干 干, 天干 合) { switch (干) { case 甲 _ when 合 is 己: return(五行.土); // 甲己合化土 case 乙 _ when 合 is 庚: return(五行.金); // 乙庚合化金 case 丙 _ when 合 is 辛: return(五行.水); // 丙辛合化水 case 丁 _ when 合 is 壬: return(五行.木); // 丁壬合化木 case _ when 合 is 癸: return(五行.火); // 戊癸合化火 default: throw new Exception($"未找到正确的合化五行,当前天干[{干}],合[{合}]"); } }
public static List <string> 的正财六亲(this 天干 主, 性别枚举 男女) { var 关系组 = new List <string>(); switch (男女) { case 性别枚举.男: 关系组.Add("妻子"); 关系组.Add("兄嫂"); 关系组.Add("弟媳"); 关系组.Add("舅表姐妹"); 关系组.Add("大小姨子"); break; case 性别枚举.女: 关系组.Add("父亲"); 关系组.Add("伯叔"); 关系组.Add("外孙儿"); 关系组.Add("舅表兄弟"); break; } return(关系组); }
public static List <string> 的偏官六亲(this 天干 主, 性别枚举 男女) { var 关系组 = new List <string>(); switch (男女) { case 性别枚举.男: 关系组.Add("儿子"); 关系组.Add("姐夫"); 关系组.Add("妹婿"); 关系组.Add("侄儿"); 关系组.Add("姑表兄弟"); break; case 性别枚举.女: 关系组.Add("情人"); 关系组.Add("儿媳"); 关系组.Add("姑表姐妹"); 关系组.Add("外婆"); 关系组.Add("大小姑子"); break; } return(关系组); }
public static bool 的正财是(this 天干 主, 天干 客) => 主.正财() == 客;
public static 天干 偏财(this 天干 主) { return(干支表.天干列表.Find(客 => 主.五行.我克() == 客.五行 && 主.阴阳 == 客.阴阳)); }
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; } 本气 = 本?.称; 中气 = 中?.称; 余气 = 余?.称; }
public static bool 的偏官是(this 天干 主, 天干 客) => 主.偏官() == 客;
public static bool 的正官是(this 天干 主, 天干 客) => 主.正官() == 客;
public static bool 的偏印是(this 天干 主, 天干 客) => 主.偏印() == 客;
public static bool 的正印是(this 天干 主, 天干 客) => 主.正印() == 客;
public static bool 的劫财是(this 天干 主, 天干 客) => 主.劫财() == 客;
public static bool 的比肩是(this 天干 主, 天干 客) => 主.比肩() == 客;
public static bool 的伤官是(this 天干 主, 天干 客) => 主.伤官() == 客;
public static bool 的食神是(this 天干 主, 天干 客) => 主.食神() == 客;
public static 长生枚举 在地支的长生(this 天干 干, 地支 支) => 地支长生(干, 支);
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($"未找到地支匹配的长生,当前天干[{干}],当前地支[{支}]"); } }
public static bool 的偏财是(this 天干 主, 天干 客) => 主.偏财() == 客;