コード例 #1
0
ファイル: BaZiBiz.cs プロジェクト: Kjubo/luckysign
        private PublicValue.TianGan HourTG(PublicValue.TianGan dayTG, int hour)
        {
            if (hour == 23)
            {
                hour = 0;
            }
            int flag = ((int)dayTG) % 5 * 2;
            PublicValue.TianGan ret;
            ret = (PublicValue.TianGan)Enum.Parse(typeof(PublicValue.TianGan), ((flag+(hour+1)/2)%10).ToString());

            return ret;
        }
コード例 #2
0
ファイル: BaZiBiz.cs プロジェクト: Kjubo/luckysign
 /// <summary>
 /// 旺衰,十天干生旺死绝
 /// </summary>
 /// <param name="source"></param>
 /// <param name="riyuan"></param>
 /// <returns></returns>
 private PublicValue.ZiWeiChangSheng GetWangShuai(PublicValue.DiZhi source, PublicValue.TianGan riyuan)
 {
     int[] begins = { 11, 6, 2, 9, 2, 9, 5, 0, 8, 3 };
     PublicValue.ZiWeiChangSheng ret = new PublicValue.ZiWeiChangSheng();
     if ((int)riyuan % 2 == 0)//阳干
     {
         int begin = begins[(int)riyuan];
         ret = (PublicValue.ZiWeiChangSheng)(((int)source - begin + 12) % 12);
     }
     else //阴干
     {
         int begin = begins[(int)riyuan];
         ret = (PublicValue.ZiWeiChangSheng)((begin-(int)source + 12) % 12);
     }
     return ret;
 }
コード例 #3
0
ファイル: BaZiBiz.cs プロジェクト: Kjubo/luckysign
 /// <summary>
 /// 驿马
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 private List<PublicValue.DiZhi> GetYiMa(PublicValue.DiZhi input)
 {
     List<PublicValue.DiZhi> ret = new List<PublicValue.DiZhi>();
     switch (((int)input)%3)
     {
         case 0:
             ret.Add(PublicValue.DiZhi.yin);
             ret.Add(PublicValue.DiZhi.wu);
             ret.Add(PublicValue.DiZhi.xu);
             break;
         case 1:
             ret.Add(PublicValue.DiZhi.hai);
             ret.Add(PublicValue.DiZhi.mao);
             ret.Add(PublicValue.DiZhi.wei);
             break;
         case 2:
             ret.Add(PublicValue.DiZhi.shen);
             ret.Add(PublicValue.DiZhi.zi);
             ret.Add(PublicValue.DiZhi.chen);
             break;
         case 3:
             ret.Add(PublicValue.DiZhi.si);
             ret.Add(PublicValue.DiZhi.you);
             ret.Add(PublicValue.DiZhi.chou);
             break;
     }
     return ret;
 }
コード例 #4
0
ファイル: BaZiBiz.cs プロジェクト: Kjubo/luckysign
        public PublicValue.TianGan MinuteTG(PublicValue.TianGan hourTG, int minute)
        {
            int flag = ((int)hourTG) % 5*2;
            PublicValue.TianGan ret;
            ret = (PublicValue.TianGan)Enum.Parse(typeof(PublicValue.TianGan), ((flag + minute / 10) % 10).ToString());

            return ret;
        }
コード例 #5
0
ファイル: BaZiBiz.cs プロジェクト: Kjubo/luckysign
 private PublicValue.DiZhi GetLuShen(PublicValue.TianGan input)
 {
     switch ((int)input)
     {
         case 0:
             return PublicValue.DiZhi.yin;
             break;
         case 1:
             return PublicValue.DiZhi.mao;
             break;
         case 2:
         case 4:
             return PublicValue.DiZhi.si;
             break;
         case 3:
         case 5:
             return PublicValue.DiZhi.wu;
             break;
         case 6:
             return PublicValue.DiZhi.shen;
             break;
         case 7:
             return PublicValue.DiZhi.you;
             break;
         case 8:
             return PublicValue.DiZhi.hai;
             break;
         case 9:
         default:
             return PublicValue.DiZhi.zi;
             break;
     }
 }
コード例 #6
0
ファイル: TimeToBazi.aspx.cs プロジェクト: Kjubo/luckysign
 private void SetDayun(ref BaZiMod bazi,PublicValue.TianGan G,PublicValue.DiZhi Z)
 {
     for (int i = 0; i < bazi.Dayun.Length; i++)
     {
         bazi.Dayun[i] = new BaZiDaYun();
         if ((bazi.YinYang == PublicValue.ShuXing.yang && bazi.Gender == AppCmn.AppEnum.Gender.male) ||
             (bazi.YinYang == PublicValue.ShuXing.yin && bazi.Gender == AppCmn.AppEnum.Gender.female))//顺
         {
             bazi.Dayun[i].YearTG = (PublicValue.TianGan)(((int)G + 1 + i) % 10);
             bazi.Dayun[i].YearDZ = (PublicValue.DiZhi)(((int)Z + 1 + i) % 12);
         }
         else//逆
         {
             bazi.Dayun[i].YearTG = (PublicValue.TianGan)(((int)G - 1 - i + 20) % 10);
             bazi.Dayun[i].YearDZ = (PublicValue.DiZhi)(((int)Z - 1 - i + 24) % 12);
         }
         bazi.Dayun[i].Begin = bazi.JiaoYun.Year + 10 * i;
         bazi.Dayun[i].End = bazi.Dayun[i].Begin + 9;
         bazi.Dayun[i].NaYin = (PublicValue.Nayin)((int)bazi.Dayun[i].YearTG * 10 + bazi.Dayun[i].YearDZ);
         bazi.Dayun[i].ShiShen = PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.Dayun[i].YearTG, bazi.DayTG)).ShiShen;
     }
 }
コード例 #7
0
ファイル: WuXing.cs プロジェクト: Kjubo/luckysign
        /// <summary>
        /// 五行判断,A对B的作用,B的能量增减.
        /// 分同异: (同,异)帮,生,克,耗,泄,晦,脆,帮克,帮耗
        /// 分增减: 合(增,减),生合
        /// 其他: 对冲,互刑,相害,
        /// </summary>
        /// <param name="a">A</param>
        /// <param name="b">B</param>
        /// <returns></returns>
        public string GZWuXing(PublicValue.DiZhi a, PublicValue.DiZhi b)
        {
            string ret = "";
            if (a == "子")
            {
                if (b == "子")
                    ret = "同帮";
                else if (b == "丑")
                    ret = "合减";
                else if (b == "寅")
                    ret = "同生";
                else if (b == "卯")
                    ret = "异生";
                else if (b == "辰")
                    ret = "合减";
                else if (b == "巳")
                    ret = "异克";
                else if (b == "午")
                    ret = "对冲";
                else if (b == "未")
                    ret = "相害";
                else if (b == "申")
                    ret = "同泄";
                else if (b == "酉")
                    ret = "异泄";
                else if (b == "戌")
                    ret = "同耗";
                else if (b == "亥")
                    ret = "异帮";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "丑")
            {
                if (b == "子")
                    ret = "合减";
                else if (b == "丑")
                    ret = "同帮";
                else if (b == "寅")
                    ret = "异耗";
                else if (b == "卯")
                    ret = "同耗";
                else if (b == "辰")
                    ret = "异帮";
                else if (b == "巳")
                    ret = "同晦";
                else if (b == "午")
                    ret = "异晦";
                else if (b == "未")
                    ret = "对冲";
                else if (b == "申")
                    ret = "异生";
                else if (b == "酉")
                    ret = "合增";
                else if (b == "戌")
                    ret = "互刑";
                else if (b == "亥")
                    ret = "同帮克";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "寅")
            {
                if (b == "子")
                    ret = "同泄";
                else if (b == "丑")
                    ret = "异克";
                else if (b == "寅")
                    ret = "同帮";
                else if (b == "卯")
                    ret = "异帮";
                else if (b == "辰")
                    ret = "同克";
                else if (b == "巳")
                    ret = "异泄";
                else if (b == "午")
                    ret = "同泄";
                else if (b == "未")
                    ret = "异克";
                else if (b == "申")
                    ret = "对冲";
                else if (b == "酉")
                    ret = "异耗";
                else if (b == "戌")
                    ret = "同克";
                else if (b == "亥")
                    ret = "合减";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "卯")
            {
                if (b == "子")
                    ret = "异泄";
                else if (b == "丑")
                    ret = "同克";
                else if (b == "寅")
                    ret = "异帮";
                else if (b == "卯")
                    ret = "同帮";
                else if (b == "辰")
                    ret = "异克";
                else if (b == "巳")
                    ret = "同生";
                else if (b == "午")
                    ret = "异生";
                else if (b == "未")
                    ret = "合减";
                else if (b == "申")
                    ret = "异耗";
                else if (b == "酉")
                    ret = "对冲";
                else if (b == "戌")
                    ret = "合增";
                else if (b == "亥")
                    ret = "合减";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "辰")
            {
                if (b == "子")
                    ret = "合减";
                else if (b == "丑")
                    ret = "异帮";
                else if (b == "寅")
                    ret = "同耗";
                else if (b == "卯")
                    ret = "异耗";
                else if (b == "辰")
                    ret = "同帮";
                else if (b == "巳")
                    ret = "异晦";
                else if (b == "午")
                    ret = "同晦";
                else if (b == "未")
                    ret = "互刑";
                else if (b == "申")
                    ret = "同生";
                else if (b == "酉")
                    ret = "合增";
                else if (b == "戌")
                    ret = "对冲";
                else if (b == "亥")
                    ret = "异帮克";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "巳")
            {
                if (b == "子")
                    ret = "异耗";
                else if (b == "丑")
                    ret = "同生";
                else if (b == "寅")
                    ret = "异泄";
                else if (b == "卯")
                    ret = "同泄";
                else if (b == "辰")
                    ret = "异生";
                else if (b == "巳")
                    ret = "同帮";
                else if (b == "午")
                    ret = "异帮";
                else if (b == "未")
                    ret = "同生";
                else if (b == "申")
                    ret = "合减";
                else if (b == "酉")
                    ret = "合减";
                else if (b == "戌")
                    ret = "异生";
                else if (b == "亥")
                    ret = "对冲";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "午")
            {
                if (b == "子")
                    ret = "对冲";
                else if (b == "丑")
                    ret = "异生";
                else if (b == "寅")
                    ret = "同泄";
                else if (b == "卯")
                    ret = "异泄";
                else if (b == "辰")
                    ret = "同生";
                else if (b == "巳")
                    ret = "异帮";
                else if (b == "午")
                    ret = "同帮";
                else if (b == "未")
                    ret = "合增";
                else if (b == "申")
                    ret = "同克";
                else if (b == "酉")
                    ret = "异克";
                else if (b == "戌")
                    ret = "合增";
                else if (b == "亥")
                    ret = "异耗";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "未")
            {
                if (b == "子")
                    ret = "相害";
                else if (b == "丑")
                    ret = "对冲";
                else if (b == "寅")
                    ret = "异耗";
                else if (b == "卯")
                    ret = "合减";
                else if (b == "辰")
                    ret = "互刑";
                else if (b == "巳")
                    ret = "同生";
                else if (b == "午")
                    ret = "合减";
                else if (b == "未")
                    ret = "同帮";
                else if (b == "申")
                    ret = "异脆";
                else if (b == "酉")
                    ret = "同脆";
                else if (b == "戌")
                    ret = "异帮";
                else if (b == "亥")
                    ret = "同克";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "申")
            {
                if (b == "子")
                    ret = "同生";
                else if (b == "丑")
                    ret = "异泄";
                else if (b == "寅")
                    ret = "对冲";
                else if (b == "卯")
                    ret = "异克";
                else if (b == "辰")
                    ret = "同泄";
                else if (b == "巳")
                    ret = "合减";
                else if (b == "午")
                    ret = "同耗";
                else if (b == "未")
                    ret = "异泄";
                else if (b == "申")
                    ret = "同帮";
                else if (b == "酉")
                    ret = "异帮";
                else if (b == "戌")
                    ret = "同泄";
                else if (b == "亥")
                    ret = "异生";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "酉")
            {
                if (b == "子")
                    ret = "异生";
                else if (b == "丑")
                    ret = "合减";
                else if (b == "寅")
                    ret = "异克";
                else if (b == "卯")
                    ret = "对冲";
                else if (b == "辰")
                    ret = "合减";
                else if (b == "巳")
                    ret = "合减";
                else if (b == "午")
                    ret = "异耗";
                else if (b == "未")
                    ret = "同泄";
                else if (b == "申")
                    ret = "异帮";
                else if (b == "酉")
                    ret = "同帮";
                else if (b == "戌")
                    ret = "异泄";
                else if (b == "亥")
                    ret = "同生";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "戌")
            {
                if (b == "子")
                    ret = "同克";
                else if (b == "丑")
                    ret = "互刑";
                else if (b == "寅")
                    ret = "同耗";
                else if (b == "卯")
                    ret = "合减";
                else if (b == "辰")
                    ret = "对冲";
                else if (b == "巳")
                    ret = "异生";
                else if (b == "午")
                    ret = "合减";
                else if (b == "未")
                    ret = "异帮";
                else if (b == "申")
                    ret = "同脆";
                else if (b == "酉")
                    ret = "异脆";
                else if (b == "戌")
                    ret = "同帮";
                else if (b == "亥")
                    ret = "异克";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "亥")
            {
                if (b == "子")
                    ret = "异帮";
                else if (b == "丑")
                    ret = "同帮耗";
                else if (b == "寅")
                    ret = "合增";
                else if (b == "卯")
                    ret = "合增";
                else if (b == "辰")
                    ret = "异帮耗";
                else if (b == "巳")
                    ret = "对冲";
                else if (b == "午")
                    ret = "异克";
                else if (b == "未")
                    ret = "同耗";
                else if (b == "申")
                    ret = "异泄";
                else if (b == "酉")
                    ret = "同泄";
                else if (b == "戌")
                    ret = "异耗";
                else if (b == "亥")
                    ret = "同帮";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "甲")
            {
                if (b == "子")
                    ret = "同泄";
                else if (b == "丑")
                    ret = "异克";
                else if (b == "寅")
                    ret = "同帮";
                else if (b == "卯")
                    ret = "异帮";
                else if (b == "辰")
                    ret = "同克";
                else if (b == "巳")
                    ret = "异生";
                else if (b == "午")
                    ret = "同生";
                else if (b == "未")
                    ret = "异克";
                else if (b == "申")
                    ret = "同耗";
                else if (b == "酉")
                    ret = "异耗";
                else if (b == "戌")
                    ret = "同克";
                else if (b == "亥")
                    ret = "异泄";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "乙")
            {
                if (b == "子")
                    ret = "";
                else if (b == "丑")
                    ret = "";
                else if (b == "寅")
                    ret = "";
                else if (b == "卯")
                    ret = "";
                else if (b == "辰")
                    ret = "";
                else if (b == "巳")
                    ret = "";
                else if (b == "午")
                    ret = "";
                else if (b == "未")
                    ret = "";
                else if (b == "申")
                    ret = "";
                else if (b == "酉")
                    ret = "";
                else if (b == "戌")
                    ret = "";
                else if (b == "亥")
                    ret = "";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "丙")
            {
                if (b == "子")
                    ret = "同耗";
                else if (b == "丑")
                    ret = "异生";
                else if (b == "寅")
                    ret = "同泄";
                else if (b == "卯")
                    ret = "异泄";
                else if (b == "辰")
                    ret = "同生";
                else if (b == "巳")
                    ret = "异帮";
                else if (b == "午")
                    ret = "异帮";
                else if (b == "未")
                    ret = "同生";
                else if (b == "申")
                    ret = "异克";
                else if (b == "酉")
                    ret = "同克";
                else if (b == "戌")
                    ret = "异生";
                else if (b == "亥")
                    ret = "异耗";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "丁")
            {
                if (b == "子")
                    ret = "";
                else if (b == "丑")
                    ret = "";
                else if (b == "寅")
                    ret = "";
                else if (b == "卯")
                    ret = "";
                else if (b == "辰")
                    ret = "";
                else if (b == "巳")
                    ret = "";
                else if (b == "午")
                    ret = "";
                else if (b == "未")
                    ret = "";
                else if (b == "申")
                    ret = "";
                else if (b == "酉")
                    ret = "";
                else if (b == "戌")
                    ret = "";
                else if (b == "亥")
                    ret = "";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "戊")
            {
                if (b == "子")
                    ret = "同克";
                else if (b == "丑")
                    ret = "异帮";
                else if (b == "寅")
                    ret = "同耗";
                else if (b == "卯")
                    ret = "异耗";
                else if (b == "辰")
                    ret = "同帮";
                else if (b == "巳")
                    ret = "异泄";
                else if (b == "午")
                    ret = "同泄";
                else if (b == "未")
                    ret = "异帮";
                else if (b == "申")
                    ret = "同生";
                else if (b == "酉")
                    ret = "异生";
                else if (b == "戌")
                    ret = "同帮";
                else if (b == "亥")
                    ret = "异克";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "己")
            {
                if (b == "子")
                    ret = "";
                else if (b == "丑")
                    ret = "";
                else if (b == "寅")
                    ret = "";
                else if (b == "卯")
                    ret = "";
                else if (b == "辰")
                    ret = "";
                else if (b == "巳")
                    ret = "";
                else if (b == "午")
                    ret = "";
                else if (b == "未")
                    ret = "";
                else if (b == "申")
                    ret = "";
                else if (b == "酉")
                    ret = "";
                else if (b == "戌")
                    ret = "";
                else if (b == "亥")
                    ret = "";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "庚")
            {
                if (b == "子")
                    ret = "同生";
                else if (b == "丑")
                    ret = "异泄";
                else if (b == "寅")
                    ret = "同克";
                else if (b == "卯")
                    ret = "异克";
                else if (b == "辰")
                    ret = "同泄";
                else if (b == "巳")
                    ret = "异耗";
                else if (b == "午")
                    ret = "同耗";
                else if (b == "未")
                    ret = "异泄";
                else if (b == "申")
                    ret = "同帮";
                else if (b == "酉")
                    ret = "异帮";
                else if (b == "戌")
                    ret = "同泄";
                else if (b == "亥")
                    ret = "异生";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "辛")
            {
                if (b == "子")
                    ret = "";
                else if (b == "丑")
                    ret = "";
                else if (b == "寅")
                    ret = "";
                else if (b == "卯")
                    ret = "";
                else if (b == "辰")
                    ret = "";
                else if (b == "巳")
                    ret = "";
                else if (b == "午")
                    ret = "";
                else if (b == "未")
                    ret = "";
                else if (b == "申")
                    ret = "";
                else if (b == "酉")
                    ret = "";
                else if (b == "戌")
                    ret = "";
                else if (b == "亥")
                    ret = "";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "壬")
            {
                if (b == "子")
                    ret = "同帮";
                else if (b == "丑")
                    ret = "异耗";
                else if (b == "寅")
                    ret = "同生";
                else if (b == "卯")
                    ret = "异生";
                else if (b == "辰")
                    ret = "同耗";
                else if (b == "巳")
                    ret = "异克";
                else if (b == "午")
                    ret = "同克";
                else if (b == "未")
                    ret = "异耗";
                else if (b == "申")
                    ret = "同泄";
                else if (b == "酉")
                    ret = "异泄";
                else if (b == "戌")
                    ret = "同耗";
                else if (b == "亥")
                    ret = "异帮";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            else if (a == "癸")
            {
                if (b == "子")
                    ret = "";
                else if (b == "丑")
                    ret = "";
                else if (b == "寅")
                    ret = "";
                else if (b == "卯")
                    ret = "";
                else if (b == "辰")
                    ret = "";
                else if (b == "巳")
                    ret = "";
                else if (b == "午")
                    ret = "";
                else if (b == "未")
                    ret = "";
                else if (b == "申")
                    ret = "";
                else if (b == "酉")
                    ret = "";
                else if (b == "戌")
                    ret = "";
                else if (b == "亥")
                    ret = "";
                else if (b == "甲")
                    ret = "";
                else if (b == "乙")
                    ret = "";
                else if (b == "丙")
                    ret = "";
                else if (b == "丁")
                    ret = "";
                else if (b == "戊")
                    ret = "";
                else if (b == "己")
                    ret = "";
                else if (b == "庚")
                    ret = "";
                else if (b == "辛")
                    ret = "";
                else if (b == "壬")
                    ret = "";
                else if (b == "癸")
                    ret = "";

            }
            return ret;
        }
コード例 #8
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
 public PublicValue.Element GetConstellationElement(PublicValue.Constellation input)
 {
     if (input == PublicValue.Constellation.Ari ||
                 input == PublicValue.Constellation.Leo ||
                 input == PublicValue.Constellation.Sag)
     {
         return PublicValue.Element.fire;
     }
     else if (input == PublicValue.Constellation.Aqu ||
         input == PublicValue.Constellation.Gem ||
        input == PublicValue.Constellation.Lib)
     {
         return PublicValue.Element.wind;
     }
     else if (input == PublicValue.Constellation.Can ||
         input == PublicValue.Constellation.Pis ||
        input == PublicValue.Constellation.Sco)
     {
         return PublicValue.Element.aqua;
     }
     else if (input == PublicValue.Constellation.Cap ||
         input == PublicValue.Constellation.Tau ||
         input == PublicValue.Constellation.Vir)
     {
         return PublicValue.Element.earth;
     }
     else
     {
         return PublicValue.Element.fire;
     }
 }
コード例 #9
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
        /// <summary>
        /// 获取守护星
        /// </summary>
        /// <param name="second">是否包括第二守护星</param> 
        /// <returns></returns>
        public List<PublicValue.AstroStar> GetShouHu(PublicValue.Constellation input,bool second)
        {
            List<PublicValue.AstroStar> ret = new List<PublicValue.AstroStar>();

            switch (input)
            {
                case PublicValue.Constellation.Ari:
                    ret.Add(PublicValue.AstroStar.Mar);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Sun);
                    break;
                case PublicValue.Constellation.Tau:
                    ret.Add(PublicValue.AstroStar.Ven);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Moo);
                    break;
                case PublicValue.Constellation.Gem:
                    ret.Add(PublicValue.AstroStar.Mer);
                    break;
                case PublicValue.Constellation.Can:
                    ret.Add(PublicValue.AstroStar.Moo);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Jup);
                    break;
                case PublicValue.Constellation.Leo:
                    ret.Add(PublicValue.AstroStar.Sun);
                    break;
                case PublicValue.Constellation.Vir:
                    ret.Add(PublicValue.AstroStar.Mer);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Plu);
                    break;
                case PublicValue.Constellation.Lib:
                    ret.Add(PublicValue.AstroStar.Ven);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Sat);
                    break;
                case PublicValue.Constellation.Sco:
                    ret.Add(PublicValue.AstroStar.Plu);
                    ret.Add(PublicValue.AstroStar.Mar);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Ura);
                    break;
                case PublicValue.Constellation.Sag:
                    ret.Add(PublicValue.AstroStar.Jup);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Nep);
                    break;
                case PublicValue.Constellation.Cap:
                    ret.Add(PublicValue.AstroStar.Sat);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Mar);
                    break;
                case PublicValue.Constellation.Aqu:
                    ret.Add(PublicValue.AstroStar.Ura);
                    ret.Add(PublicValue.AstroStar.Sat);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Mer);
                    break;
                case PublicValue.Constellation.Pis:
                    ret.Add(PublicValue.AstroStar.Jup);
                    ret.Add(PublicValue.AstroStar.Nep);
                    if (second)
                        ret.Add(PublicValue.AstroStar.Ven);
                    break;
            }

            return ret;
        }
コード例 #10
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
 public WuXingRelation(PublicValue.DiZhi source, PublicValue.DiZhi target)
 {
     sourcedz = source;
     sourceType = 1;
     targetdz = target;
     targetType = 1;
 }
コード例 #11
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
 public WuXingRelation(PublicValue.DiZhi source, PublicValue.TianGan target)
 {
     sourcedz = source;
     sourceType = 1;
     targettg = target;
     targetType = 0;
 }
コード例 #12
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
 public WuXingRelation(PublicValue.TianGan source, PublicValue.DiZhi target)
 {
     sourcetg = source;
     sourceType = 0;
     targetdz = target;
     targetType = 1;
 }
コード例 #13
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
 public WuXingRelation(PublicValue.TianGan source ,PublicValue.TianGan target)
 {
     sourcetg = source;
     sourceType = 0;
     targettg = target;
     targetType = 0;
 }
コード例 #14
0
ファイル: PublicDeal.cs プロジェクト: Kjubo/luckysign
        public bool HasPhase(Star a, Star b, PublicValue.Phase phase, decimal offset)
        {
            if (offset == AppConst.DecimalNull)
            {
                switch (phase)
                {
                    case PublicValue.Phase.he:
                        offset = 10;
                        break;
                    case PublicValue.Phase.xing:
                        offset = 8;
                        break;
                    case PublicValue.Phase.chong:
                        offset = 8;
                        break;
                    case PublicValue.Phase.gong:
                        offset = 8;
                        break;
                    case PublicValue.Phase.bangong:
                        offset = 5;
                        break;
                }
            }

            decimal degreeA = ((int)a.Constellation-1) * 30 + a.Degree + a.Cent / 60;
            decimal degreeB = ((int)b.Constellation-1) * 30 + b.Degree + b.Cent / 60;

            decimal angle = Math.Abs(degreeA - degreeB);
            if (angle > 180)
            {
                angle = 360 - angle;
            }

            if (angle <= offset + (int)phase && angle >= (int)phase - offset)
            {
                return true;
            }
            else
            {
                return false;
            }
        }