Example #1
0
        static WuXing()
        {
            instances = new WuXing[BaseDef.WuXings.Length];

            for (int idx = 0; idx < instances.Length; idx++)
            {
                instances[idx] = new WuXing(idx, BaseDef.WuXings[idx]);
            }
        }
Example #2
0
        private void Calc卦爻(bool kurz = false)
        {
            WuXing me      = this.本卦.卦宫.五行;
            int    idx     = 0;
            int    shiyao  = this.本卦.世爻;
            int    yingyao = (shiyao + 3) % 6;

            this.lines.ForEach(l =>
            {
                l.世应 = string.Empty;
                l.世应 = shiyao == idx ? "世" : l.世应;
                l.世应 = yingyao == idx ? "应" : l.世应;

                GuaYao fuyao = new GuaYao()
                {
                    干支 = this.伏卦.干支(idx)
                };
                l.伏爻    = fuyao;
                l.伏爻.五神 = 十神.Calc5(me, fuyao.干支.Zhi, kurz);

                GuaYao benyao = new GuaYao()
                {
                    干支 = this.本卦.干支(idx)
                };
                l.本爻    = benyao;
                l.本爻.五神 = 十神.Calc5(me, benyao.干支.Zhi, kurz);
                l.本爻.阴阳 = (阴阳)this.本卦.阴阳(idx);

                if (this.本卦 != this.变卦)
                {
                    GuaYao bianyao = new GuaYao()
                    {
                        干支 = this.变卦.干支(idx)
                    };
                    l.变爻    = bianyao;
                    l.变爻.五神 = 十神.Calc5(me, bianyao.干支.Zhi, kurz);
                    l.变爻.阴阳 = (阴阳)this.变卦.阴阳(idx);

                    if (l.本爻.阴阳 != l.变爻.阴阳)
                    {
                        l.本爻.阴阳 = (阴阳)(this.本卦.阴阳(idx) + 2);
                    }
                }

                idx++;
            });
        }