Example #1
0
        /// <summary>
        /// 干合 テーブルによる干文字の虚気文字変換
        /// </summary>
        /// <param name="colorNikkansi"></param>
        /// <param name="colorGekkansi"></param>
        /// <param name="colorNenkansi"></param>
        public void RefrectKangou(Kansi nikkansi, Kansi gekkansi, Kansi nenkansi)
        {
            var tblMng = TableMng.GetTblManage();

            //================================================
            //干合
            //================================================
            //日(干) - 月(干)
            var kyoki = tblMng.kangouTbl.GetKyoki(nikkansi.kan, gekkansi.kan);

            if (kyoki != null)
            {
                nikkansi.kan = kyoki[0];
                gekkansi.kan = kyoki[1];
            }
            //日(干) - 年(干)
            kyoki = tblMng.kangouTbl.GetKyoki(nikkansi.kan, nenkansi.kan);
            if (kyoki != null)
            {
                nikkansi.kan = kyoki[0];
                nenkansi.kan = kyoki[1];
            }
            //月(干) - 年(干)
            kyoki = tblMng.kangouTbl.GetKyoki(gekkansi.kan, nenkansi.kan);
            if (kyoki != null)
            {
                gekkansi.kan = kyoki[0];
                nenkansi.kan = kyoki[1];
            }
        }
Example #2
0
            /// <summary>
            /// 基本属性マトリクス情報を作成
            /// </summary>
            /// <param name="person"></param>
            /// <param name="getuun"></param>
            /// <param name="nenun"></param>
            /// <param name="taiun"></param>
            public void CreateGogyouAttrMatrix(Person person, Kansi getuun = null, Kansi nenun = null, Kansi taiun = null)
            {
                var tblMng = TableMng.GetTblManage();

                //月運
                if (getuun != null)
                {
                    attrTbl[(int)Const.enumKansiItemID.GETUUN].Init(tblMng.jyukanTbl[getuun.kan].gogyou, tblMng.jyunisiTbl[getuun.si].gogyou);
                }
                //年運
                if (nenun != null)
                {
                    attrTbl[(int)Const.enumKansiItemID.NENUN].Init(tblMng.jyukanTbl[nenun.kan].gogyou, tblMng.jyunisiTbl[nenun.si].gogyou);
                }
                //大運
                if (taiun != null)
                {
                    attrTbl[(int)Const.enumKansiItemID.TAIUN].Init(tblMng.jyukanTbl[taiun.kan].gogyou, tblMng.jyunisiTbl[taiun.si].gogyou);
                }

                //日干支
                attrTbl[(int)Const.enumKansiItemID.NIKKANSI].Init(tblMng.jyukanTbl[person.nikkansi.kan].gogyou, tblMng.jyunisiTbl[person.nikkansi.si].gogyou);
                //月干支
                attrTbl[(int)Const.enumKansiItemID.GEKKANSI].Init(tblMng.jyukanTbl[person.gekkansi.kan].gogyou, tblMng.jyunisiTbl[person.gekkansi.si].gogyou);
                //年干支
                attrTbl[(int)Const.enumKansiItemID.NENKANSI].Init(tblMng.jyukanTbl[person.nenkansi.kan].gogyou, tblMng.jyunisiTbl[person.nenkansi.si].gogyou);
            }
Example #3
0
        /// <summary>
        /// 納音、準納音 取得
        /// </summary>
        /// <param name="nenunKansi"></param>
        /// <param name="kansi"></param>
        /// <returns></returns>
        public string GetNentin(Kansi nenunKansi, Kansi kansi)
        {
            int nenunKansiNo = tblMng.kansiTbl.GetKansiNo(nenunKansi);
            int kansiNo      = tblMng.kansiTbl.GetKansiNo(kansi);

            int dif = 0;

            if (nenunKansiNo <= kansiNo)
            {
                dif = kansiNo - nenunKansiNo;
            }
            else
            {
                dif = nenunKansiNo - kansiNo;
            }

            if (dif == 30)
            {
                return("納音");
            }
            if (dif == 29 || dif == 31)
            {
                //nenunKansiの干とkansiの干が同じ五行の陰陽の関係か?
                var nenunKansiJyukan = tblMng.jyukanTbl[nenunKansi.kan];
                var kansiJyukan      = tblMng.jyukanTbl[kansi.kan];

                if (nenunKansiJyukan.gogyou == kansiJyukan.gogyou)
                {
                    return("準納音");
                }
            }

            return("");
        }
Example #4
0
        public int Simulation(Person person,
                              Kansi getuunKansi,
                              Kansi nenunKansi,
                              Kansi taiunKansi,
                              bool bDispGetuun
                              )
        {
            aryKansiOrg = new Kansi[]
            {
                getuunKansi, nenunKansi, taiunKansi,
                person.nikkansi, person.nenkansi, person.gekkansi,
            };

            //シミュレーションでPersonが保持している情報が書き変わってしまわないようCloseを作成
            Kansi _nikkansi = person.nikkansi.Clone();
            Kansi _nenkansi = person.nenkansi.Clone();
            Kansi _gekkansi = person.gekkansi.Clone();

            Kansi _getuunKansi = getuunKansi.Clone();
            Kansi _nenunKansi  = nenunKansi.Clone();
            Kansi _taiunKansi  = taiunKansi.Clone();

            Kansi[] aryKansi = new Kansi[] { _getuunKansi, _nenunKansi, _taiunKansi, _nikkansi, _gekkansi, _nenkansi };

            DoSim(aryKansi, bDispGetuun);
            return(0);
        }
Example #5
0
        /// <summary>
        /// 律音、準律音 取得
        /// </summary>
        /// <param name="nenunKansi"></param>
        /// <param name="kansi"></param>
        /// <returns></returns>
        public string GetNittin(Kansi nenunKansi, Kansi kansi)
        {
            int nenunKansiNo = tblMng.kansiTbl.GetKansiNo(nenunKansi);
            int kansiNo      = tblMng.kansiTbl.GetKansiNo(kansi);

            if (nenunKansiNo == kansiNo)
            {
                return("律音");
            }
            else
            {
                int dif = Math.Abs(kansiNo - nenunKansiNo);
                if (kansiNo == 1 && nenunKansiNo == 60 ||
                    kansiNo == 60 && nenunKansiNo == 1 ||
                    dif == 1)
                {
                    //nenunKansiの干とkansiの干が同じ五行の陰陽の関係か?
                    var nenunKansiJyukan = tblMng.jyukanTbl[nenunKansi.kan];
                    var kansiJyukan      = tblMng.jyukanTbl[kansi.kan];

                    if (nenunKansiJyukan.gogyou == kansiJyukan.gogyou)
                    {
                        return("準律音");
                    }
                }
            }

            return("");
        }
Example #6
0
 public KansiInfo(Kansi[] _aryKansi)
 {
     aryKansi = new Kansi[_aryKansi.Length];
     for (int i = 0; i < aryKansi.Length; i++)
     {
         aryKansi[i] = _aryKansi[i].Clone();
     }
 }
Example #7
0
        public bool IsSame(Kansi kansi)
        {
            if (kan == kansi.kan && si == kansi.si)
            {
                return(true);
            }

            return(false);
        }
Example #8
0
            /// <summary>
            /// 干支番号から干支文字取得
            /// </summary>
            /// <param name="kansiNo">干支No</param>
            /// <returns></returns>
            public string[] GetKansiStr(int kansiNo)
            {
                Kansi kansi = GetKansi(kansiNo);

                if (kansi == null)
                {
                    return(null);
                }

                return(kansi.ToArray());
            }
        public void InitDisp(Person _person, Kansi _getuunKansi, Kansi _nenunKansi, Kansi _taiunKansi,
                             bool _bDispGetuun,
                             bool _bDispSangouKaikyoku,
                             bool _bDispGogyou,
                             bool _bDispGotoku,
                             bool _bDispRefrectGouhou,
                             bool _bDispRefrectSangouKaiyoku
                             )
        {
            KyokiSimulation sim = new KyokiSimulation();

            sim.Simulation(_person, _getuunKansi, _nenunKansi, _taiunKansi, _bDispGetuun);

            int patternNum = sim.lstKansPattern.Count;

            this.SuspendLayout();
            this.DoubleBuffered = true;

            flowLayoutPanel1.Controls.Clear();
            lstPictureBox.Clear();

            Person person = _person.Clone();

            foreach (var pattern in sim.lstKansPattern)
            {
                PictureBox pictureBox = new PictureBox();
                pictureBox.Width       = 300;
                pictureBox.Height      = 100;
                pictureBox.BorderStyle = BorderStyle.FixedSingle;
                flowLayoutPanel1.Controls.Add(pictureBox);
                lstPictureBox.Add(pictureBox);
                person.nikkansi = pattern.aryKansi[(int)Const.enumKansiItemID.NIKKANSI];
                person.gekkansi = pattern.aryKansi[(int)Const.enumKansiItemID.GEKKANSI];
                person.nenkansi = pattern.aryKansi[(int)Const.enumKansiItemID.NENKANSI];


                DrawKoutenUn drawItem2 = null;
                drawItem2 = new DrawKoutenUn(person, pictureBox,
                                             pattern.aryKansi[(int)Const.enumKansiItemID.TAIUN],
                                             pattern.aryKansi[(int)Const.enumKansiItemID.NENUN],
                                             pattern.aryKansi[(int)Const.enumKansiItemID.GETUUN],
                                             _bDispGetuun,
                                             _bDispSangouKaikyoku,
                                             _bDispGogyou,
                                             _bDispGotoku,
                                             _bDispRefrectGouhou,
                                             _bDispRefrectSangouKaiyoku
                                             );
                drawItem2.CalcCoord(0);

                drawItem2.DrawKyokiPattern();
            }
            this.ResumeLayout();
        }
Example #10
0
        /// <summary>
        /// 天殺地冲  文字列取得
        /// </summary>
        /// <param name="taiunKansi"></param>
        /// <param name="kansi"></param>
        /// <returns></returns>
        public string GetTensatuTichuString(Kansi taiunKansi, Kansi kansi)
        {
            string tensatu = GetTensatuString(taiunKansi, kansi);
            string tichu   = GetTichuString(taiunKansi, kansi);

            if (tensatu != "" && tichu != "")
            {
                return(tensatu + tichu);
            }

            return("");
        }
Example #11
0
        /// <summary>
        /// 地冲  文字列取得
        /// </summary>
        /// <param name="taiunKansi"></param>
        /// <param name="kansi"></param>
        /// <returns></returns>
        public string GetTichuString(Kansi taiunKansi, Kansi kansi)
        {
            var values = GetGouhouSanpou(taiunKansi, kansi, false, false);

            if (values != null)
            {
                foreach (var item in values)
                {
                    if (item.orgName.IndexOf("冲動") >= 0)
                    {
                        return("地冲");
                    }
                }
            }
            return("");
        }
Example #12
0
            public List <HouSaniResult> GetHouSani(Kansi getuun, Kansi nenun, Kansi taiun,
                                                   Kansi nikkansi, Kansi gekkansi, Kansi nenkansi)
            {
                SiItems[] arySi =
                {
                    new SiItems(getuun.si,   Const.bitFlgGetuun),
                    new SiItems(nenun.si,    Const.bitFlgNenun),
                    new SiItems(taiun.si,    Const.bitFlgTaiun),
                    new SiItems(nikkansi.si, Const.bitFlgNiti),
                    new SiItems(gekkansi.si, Const.bitFlgGetu),
                    new SiItems(nenkansi.si, Const.bitFlgNen),
                };

                List <HouSaniResult> lstResult = new List <HouSaniResult>();

                for (int i = 0; i < arySi.Length - 2; i++)
                {
                    for (int j = i + 1; j < arySi.Length - 1; j++)
                    {
                        for (int k = j + 1; k < arySi.Length; k++)
                        {
                            if (arySi[i].si == arySi[j].si ||
                                arySi[i].si == arySi[k].si ||
                                arySi[j].si == arySi[k].si)
                            {
                                //同じ支が1組でもあれば不成立
                                continue;
                            }
                            foreach (var item in lstHousani)
                            {
                                if (item.IsExist(arySi[i].si) &&
                                    item.IsExist(arySi[j].si) &&
                                    item.IsExist(arySi[k].si))
                                {
                                    HouSaniResult result = new HouSaniResult();
                                    result.houSani    = item;
                                    result.hitItemBit = arySi[i].bitFlg | arySi[j].bitFlg | arySi[k].bitFlg;

                                    lstResult.Add(result);
                                }
                            }
                        }
                    }
                }
                return(lstResult);
            }
Example #13
0
        //public string[] GetGouhouSanpou(string siName1, string siName2, bool bExistTensatuTichu, bool bExistNentin)
        //{
        //    return tblMng.gouhouSanpouTbl.GetGouhouSanpou(siName1, siName2, bExistTensatuTichu, bExistNentin);
        //}

        /// <summary>
        /// 合法・散法 文字をカンマ区切りで接続した1つの文字列で取得します。
        /// ・天殺地冲または、納音がある場合は、"冲動"は除外されます。
        /// ・半会の場合、2つの干支番号に20の差異があれば"大半会"に置き換えます。
        /// </summary>
        /// <param name="nenunTaiunKansi">年運、大運 干支</param>
        /// <param name="kansi">宿命干支(日、月、年)</param>
        /// <param name="bExistTensatuTichu">true...天殺地冲あり</param>
        /// <param name="bExistNentin">true...納音あり</param>
        /// <returns></returns>
        public string GetGouhouSanpouString(Kansi nenunTaiunKansi, Kansi kansi, bool bExistTensatuTichu, bool bExistNentin)
        {
            var    items = GetGouhouSanpou(nenunTaiunKansi, kansi, bExistTensatuTichu, bExistNentin);
            string s     = "";

            if (items != null)
            {
                foreach (var item in items)
                {
                    if (!item.bEnable)
                    {
                        continue;
                    }
                    if (s != "")
                    {
                        s += ",";
                    }
                    s += item.orgName;
                }
            }
            return(s);
        }
Example #14
0
 //----------------------------------------------------
 //七殺
 //----------------------------------------------------
 /// <summary>
 /// 七殺 データ取得
 /// </summary>
 /// <param name="taiunKansi"></param>
 /// <param name="kansi"></param>
 /// <returns></returns>
 public Nanasatsu GetNanasatu(Kansi taiunKansi, Kansi kansi)
 {
     return(GetNanasatu(taiunKansi.kan, kansi.kan));
 }
Example #15
0
 /// <summary>
 /// 干合 文字列取得
 /// </summary>
 /// <param name="taiunKansi"></param>
 /// <param name="kansi"></param>
 /// <returns></returns>
 public string GetKangoStr(Kansi taiunKansi, Kansi kansi)
 {
     return(tblMng.kangouTbl.GetKangouStr(taiunKansi.kan, kansi.kan));
 }
Example #16
0
 /// <summary>
 /// 大運→(日月年),年運→(日月年),他日→月などでも可
 /// </summary>
 /// <param name="kansi1"></param>
 /// <param name="kansi2"></param>
 /// <returns></returns>
 public bool IsKango(Kansi kansi1, Kansi kansi2)
 {
     return(tblMng.kangouTbl.IsKangou(kansi1.kan, kansi2.kan));
 }
Example #17
0
        /// <summary>
        /// 干合 テーブルによる干文字の虚気文字変換
        /// </summary>
        /// <param name="colorNikkansi"></param>
        /// <param name="colorGekkansi"></param>
        /// <param name="colorNenkansi"></param>
        /// <param name="colorGetuun"></param>
        /// <param name="colorNenun"></param>
        /// <param name="colorTaiun"></param>
        /// <param name="kansiGetuun"></param>
        /// <param name="kansiNenun"></param>
        /// <param name="kansiTaiun"></param>
        /// <param name="bDispGetuun"></param>
        public void RefrectKangou(Kansi nikkansi, Kansi gekkansi, Kansi nenkansi,
                                  Kansi kansiGetuun, Kansi kansiNenun, Kansi kansiTaiun,
                                  bool bDispGetuun
                                  )
        {
            var tblMng = TableMng.GetTblManage();

            string[] kyoki;
            //宿命カラー設定
            RefrectKangou(nikkansi, gekkansi, nenkansi);

            //月運、年運、大運 カラー設定
            //================================================
            //干合
            //================================================
            //----------------------------------
            // 月運 →*
            //----------------------------------
            if (bDispGetuun)
            {
                //月運(干) - 年運(干)
                kyoki = tblMng.kangouTbl.GetKyoki(kansiGetuun.kan, kansiNenun.kan);
                if (kyoki != null)
                {
                    kansiGetuun.kan = kyoki[0];
                    kansiNenun.kan  = kyoki[1];
                }
                //月運(干) - 大運(干)
                kyoki = tblMng.kangouTbl.GetKyoki(kansiGetuun.kan, kansiTaiun.kan);
                if (kyoki != null)
                {
                    kansiGetuun.kan = kyoki[0];
                    kansiTaiun.kan  = kyoki[1];
                }
                //月運(干) - 日(干)
                kyoki = tblMng.kangouTbl.GetKyoki(kansiGetuun.kan, nikkansi.kan);
                if (kyoki != null)
                {
                    kansiGetuun.kan = kyoki[0];
                    nikkansi.kan    = kyoki[1];
                }
                //月運(干) - 月(干)
                kyoki = tblMng.kangouTbl.GetKyoki(kansiGetuun.kan, gekkansi.kan);
                if (kyoki != null)
                {
                    kansiGetuun.kan = kyoki[0];
                    gekkansi.kan    = kyoki[1];
                }
                //月運(干) - 年(干)
                kyoki = tblMng.kangouTbl.GetKyoki(kansiGetuun.kan, nenkansi.kan);
                if (kyoki != null)
                {
                    kansiGetuun.kan = kyoki[0];
                    nenkansi.kan    = kyoki[1];
                }
            }
            //----------------------------------
            // 年運 →*
            //----------------------------------
            //年運(干) - 大運(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiNenun.kan, kansiTaiun.kan);
            if (kyoki != null)
            {
                kansiNenun.kan = kyoki[0];
                kansiTaiun.kan = kyoki[1];
            }
            //年運(干) - 日(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiNenun.kan, nikkansi.kan);
            if (kyoki != null)
            {
                kansiNenun.kan = kyoki[0];
                nikkansi.kan   = kyoki[1];
            }
            //年運(干) - 月(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiNenun.kan, gekkansi.kan);
            if (kyoki != null)
            {
                kansiNenun.kan = kyoki[0];
                gekkansi.kan   = kyoki[1];
            }
            //年運(干) - 年(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiNenun.kan, nenkansi.kan);
            if (kyoki != null)
            {
                kansiNenun.kan = kyoki[0];
                nenkansi.kan   = kyoki[1];
            }
            //----------------------------------
            // 大運 →*
            //----------------------------------
            //大運(干) - 日(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiTaiun.kan, nikkansi.kan);
            if (kyoki != null)
            {
                kansiTaiun.kan = kyoki[0];
                nikkansi.kan   = kyoki[1];
            }
            //大運(干) - 月(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiTaiun.kan, gekkansi.kan);
            if (kyoki != null)
            {
                kansiTaiun.kan = kyoki[0];
                gekkansi.kan   = kyoki[1];
            }
            //大運(干) - 年(干)
            kyoki = tblMng.kangouTbl.GetKyoki(kansiTaiun.kan, nenkansi.kan);
            if (kyoki != null)
            {
                kansiTaiun.kan = kyoki[0];
                nenkansi.kan   = kyoki[1];
            }
        }
Example #18
0
 /// <summary>
 /// 干支文字列から干支番号取得
 /// </summary>
 /// <param name="kansi">干支</param>
 /// <returns></returns>
 public int GetKansiNo(Kansi kansi)
 {
     return(GetKansiNo(kansi.kan, kansi.si));
 }
Example #19
0
        /// <summary>
        /// 例外表示処理
        /// </summary>
        /// <param name="kansi1">干支1</param>
        /// <param name="kansi2">干支2</param>
        /// <param name="taiun">大運干支</param>
        /// <param name="nenun">年運干支</param>
        /// <param name="values">表示文字列配列</param>
        /// <returns></returns>
        private void SetExceptionValueEnable(Kansi kansi1, Kansi kansi2, Kansi taiun, Kansi nenun, ref List <GouhouSannpouResult> values)
        {
            if (kansi1.si == "亥" && kansi2.si == "寅" ||
                kansi1.si == "寅" && kansi2.si == "亥")
            {
                bool bHit = false;
                if (taiun != null && (taiun.si == "申" || taiun.si == "巳"))
                {
                    bHit = true;
                }
                else if (nenun != null && (nenun.si == "申" || nenun.si == "巳"))
                {
                    bHit = true;
                }
                else if (IsExistStrInKansiSi(new string[] { "申", "巳" }))
                {
                    bHit = true;
                }

                if (bHit)
                {
                    foreach (var v in values)
                    {
                        v.bEnable = (v.orgName == "破") ? true : false;
                    }
                }
                else
                {
                    foreach (var v in values)
                    {
                        v.bEnable = (v.orgName == "支合") ? true : false;
                    }
                }
            }
            else if (kansi1.si == "申" && kansi2.si == "巳" ||
                     kansi1.si == "巳" && kansi2.si == "申")
            {
                bool bHit = false;
                if (taiun != null && (taiun.si == "亥" || taiun.si == "寅"))
                {
                    bHit = true;
                }
                else if (nenun != null && (nenun.si == "亥" || nenun.si == "寅"))
                {
                    bHit = true;
                }
                else if (IsExistStrInKansiSi(new string[] { "亥", "寅" }))
                {
                    bHit = true;
                }

                if (bHit)
                {
                    foreach (var v in values)
                    {
                        v.bEnable = (v.orgName == "破") ? true : false;
                        v.bEnable = (v.orgName == "生貴刑") ? true : false;
                    }
                }
                else
                {
                    foreach (var v in values)
                    {
                        v.bEnable = (v.orgName == "支合") ? true : false;
                    }
                }
            }
        }
Example #20
0
        /// <summary>
        /// 合法・散法 文字の配列を取得します。
        /// </summary>
        /// <param name="unKansi1">年運、大運干支</param>
        /// <param name="unKansi2">対象干支</param>
        /// <param name="taiunKansi">大運干支</param>
        /// <param name="nenunKansi">年運干支</param>
        /// <returns></returns>
        public GouhouSannpouResult[] GetGouhouSanpouEx(Kansi unKansi1, Kansi unKansi2, Kansi taiunKansi, Kansi nenunKansi)
        {
            List <GouhouSannpouResult> lstGouhouSanpouResult = new List <GouhouSannpouResult>();

            string nentin  = GetNentin(unKansi1, unKansi2);             //納音、準納音
            string rittin  = GetNittin(unKansi1, unKansi2);             //律音、準律音
            string tensatu = GetTensatuTichuString(unKansi1, unKansi2); //天殺地冲
            //string kangou = GetKangoStr(nenunTaiunKansi, kansi); //干合

            bool bExistNentin       = (nentin == "" ? false : true);
            bool bExistTensatuTichu = tensatu == "" ? false : true;

            string[] items = tblMng.gouhouSanpouTbl.GetGouhouSanpouEx(unKansi1.si, unKansi2.si, bExistTensatuTichu, bExistNentin);
            if (items != null)
            {
                for (int i = 0; i < items.Length; i++)
                {
                    GouhouSannpouResult result = new GouhouSannpouResult(items[i]);
                    if (items[i] == "半会")
                    {
                        //大半会判定
                        int no1 = tblMng.kansiTbl.GetKansiNo(unKansi1);
                        int no2 = tblMng.kansiTbl.GetKansiNo(unKansi2);

                        //no1に+20、または-20した地点のどちらかがno2と同じなら大半会
                        //1~60のリング状態をベースに前後方向の20差をチェックする必要がある。
                        //前方検索
                        int no = no1 + 20;
                        if (no > 60)
                        {
                            no = no % 60;
                            if (no == 0)
                            {
                                no = 60;
                            }
                        }
                        if (no == no2)
                        {
                            result.displayName = "大半会";
                        }
                        else
                        {
                            //後方検索
                            no = no1 - 20;
                            if (no < 0)
                            {
                                no += 60;
                            }
                            if (no == no2)
                            {
                                result.displayName = "大半会";
                            }
                        }
                        //if (Math.Abs( no1 - no2)== 20)
                        //{
                        //    items[i] = "大半会";
                        //}
                        //else
                        //{
                        //    if( no1 < no2)
                        //    {
                        //        if( no2 + 20 == no1 + 60)
                        //        {
                        //            items[i] = "大半会";
                        //        }
                        //    }
                        //    else
                        //    {
                        //        if (no1 + 20 == no2 + 60)
                        //        {
                        //            items[i] = "大半会";
                        //        }
                        //    }
                        //}
                    }

                    lstGouhouSanpouResult.Add(result);
                }
            }

            //例外表示のためのbEnableフラグ設定
            SetExceptionValueEnable(unKansi1, unKansi2, taiunKansi, nenunKansi, ref lstGouhouSanpouResult);

            List <GouhouSannpouResult> lstResult = new List <GouhouSannpouResult>();

            if (!string.IsNullOrEmpty(nentin))
            {
                lstResult.Add(new GouhouSannpouResult(nentin));
            }
            if (!string.IsNullOrEmpty(rittin))
            {
                lstResult.Add(new GouhouSannpouResult(rittin));
            }
            if (!string.IsNullOrEmpty(tensatu))
            {
                lstResult.Add(new GouhouSannpouResult(tensatu));
            }
//            if (!string.IsNullOrEmpty(kangou)) lstResult.Add(new GouhouSannpouResult(kangou));

            lstResult.AddRange(lstGouhouSanpouResult);

            return(lstResult.ToArray());
        }
Example #21
0
        //合法・散法
        /// <summary>
        /// 合法・散法 文字の配列を取得します。
        /// ・天殺地冲または、納音がある場合は、"冲動"は除外されます。
        /// ・半会の場合、2つの干支番号に20の差異があれば"大半会"に置き換えます。
        /// </summary>
        /// <param name="nenunTaiunKansi">年運、大運 干支</param>
        /// <param name="kansi">宿命干支(日、月、年)</param>
        /// <param name="bExistTensatuTichu">true...天殺地冲あり</param>
        /// <param name="bExistNentin">true...納音あり</param>
        /// <returns></returns>
        public GouhouSannpouResult[] GetGouhouSanpou(Kansi nenunTaiunKansi, Kansi kansi, bool bExistTensatuTichu, bool bExistNentin)
        {
            List <GouhouSannpouResult> lstResult = new List <GouhouSannpouResult>();

            string[] items = tblMng.gouhouSanpouTbl.GetGouhouSanpouEx(nenunTaiunKansi.si, kansi.si, bExistTensatuTichu, bExistNentin);
            if (items != null)
            {
                for (int i = 0; i < items.Length; i++)
                {
                    GouhouSannpouResult result = new GouhouSannpouResult(items[i]);
                    if (items[i] == "半会")
                    {
                        //大半会判定
                        int no1 = tblMng.kansiTbl.GetKansiNo(nenunTaiunKansi);
                        int no2 = tblMng.kansiTbl.GetKansiNo(kansi);

                        //no1に+20、または-20した地点のどちらかがno2と同じなら大半会
                        //1~60のリング状態をベースに前後方向の20差をチェックする必要がある。
                        //前方検索
                        int no = no1 + 20;
                        if (no > 60)
                        {
                            no = no % 60;
                            if (no == 0)
                            {
                                no = 60;
                            }
                        }
                        if (no == no2)
                        {
                            result.displayName = "大半会";
                        }
                        else
                        {
                            //後方検索
                            no = no1 - 20;
                            if (no < 0)
                            {
                                no += 60;
                            }
                            if (no == no2)
                            {
                                result.displayName = "大半会";
                            }
                        }
                        //if (Math.Abs( no1 - no2)== 20)
                        //{
                        //    items[i] = "大半会";
                        //}
                        //else
                        //{
                        //    if( no1 < no2)
                        //    {
                        //        if( no2 + 20 == no1 + 60)
                        //        {
                        //            items[i] = "大半会";
                        //        }
                        //    }
                        //    else
                        //    {
                        //        if (no1 + 20 == no2 + 60)
                        //        {
                        //            items[i] = "大半会";
                        //        }
                        //    }
                        //}
                    }

                    lstResult.Add(result);
                }
            }
            return(lstResult.ToArray());
        }
Example #22
0
 /// <summary>
 /// 大運→(日月年),年運→(日月年),他日→月などでも可
 /// </summary>
 /// <param name="kansi1"></param>
 /// <param name="kansi2"></param>
 /// <returns></returns>
 public bool IsInyou(Kansi kansi1, Kansi kansi2)
 {
     return(tblMng.jyukanTbl.IsInyou(kansi1.kan, kansi2.kan));
 }
Example #23
0
 //----------------------------------------------------
 //方三位
 //----------------------------------------------------
 /// <summary>
 /// 方三位 情報取得
 /// </summary>
 /// <param name="getuun"></param>
 /// <param name="nenun"></param>
 /// <param name="taiun"></param>
 /// <returns></returns>
 public List <TableMng.HouSaniResult> GetHouSani(Kansi getuun, Kansi nenun, Kansi taiun)
 {
     return(tblMng.housanniTbl.GetHouSani(getuun, nenun, taiun,
                                          nikkansi, gekkansi, nenkansi));
 }
Example #24
0
 //----------------------------------------------------
 //三合会局
 //----------------------------------------------------
 /// <summary>
 /// 三合会局  情報取得
 /// </summary>
 /// <param name="getuun"></param>
 /// <param name="nenun"></param>
 /// <param name="taiun"></param>
 /// <returns></returns>
 public List <TableMng.SangouKaikyokuResult> GetSangouKaikyoku(Kansi getuun, Kansi nenun, Kansi taiun)
 {
     return(tblMng.sangouKaikyokuTbl.GetSangouKaikyoku(getuun, nenun, taiun,
                                                       nikkansi, gekkansi, nenkansi));
 }
Example #25
0
 //----------------------------------------------------
 //天殺
 //----------------------------------------------------
 /// <summary>
 /// 天殺 文字列取得
 /// </summary>
 /// <param name="taiunKansi"></param>
 /// <param name="kansi"></param>
 /// <returns></returns>
 public string GetTensatuString(Kansi taiunKansi, Kansi kansi)
 {
     return(IsNanasatu(taiunKansi, kansi) ? "天殺" : "");
 }
Example #26
0
 /// <summary>
 /// 七殺判定
 /// 大運→(日月年),年運→(日月年),他日→月などでも加
 /// </summary>
 /// <param name="kansi1"></param>
 /// <param name="kansi2"></param>
 /// <returns></returns>
 public bool IsNanasatu(Kansi kansi1, Kansi kansi2)
 {
     return(IsNanasatu(kansi1.kan, kansi2.kan));
 }