Esempio n. 1
0
        private void SetThuocTinh(DiaChi dc, string thuocTinh)
        {
            var hoa = new List <ChiEnum> {
                ChiEnum.Dan, ChiEnum.Ngo, ChiEnum.Tuat
            };
            var kim = new List <ChiEnum> {
                ChiEnum.Ty, ChiEnum.Dau, ChiEnum.Suu
            };
            var thuy = new List <ChiEnum> {
                ChiEnum.Than, ChiEnum.Ti, ChiEnum.Thin
            };
            var moc = new List <ChiEnum> {
                ChiEnum.Hoi, ChiEnum.Mao, ChiEnum.Mui
            };

            if (hoa.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Hoa);
            }
            else if (kim.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Kim);
            }
            else if (thuy.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Thuy);
            }
            else if (moc.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Moc);
            }
        }
Esempio n. 2
0
        private void SetThuocTinh(DiaChi dc, string thuocTinh)
        {
            var xuan = new List <ChiEnum> {
                ChiEnum.Dan, ChiEnum.Mao, ChiEnum.Thin
            };
            var ha = new List <ChiEnum> {
                ChiEnum.Ty, ChiEnum.Ngo, ChiEnum.Mui
            };
            var thu = new List <ChiEnum> {
                ChiEnum.Than, ChiEnum.Dau, ChiEnum.Tuat
            };
            var dong = new List <ChiEnum> {
                ChiEnum.Hoi, ChiEnum.Ti, ChiEnum.Suu
            };

            if (xuan.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Moc);
            }
            else if (ha.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Hoa);
            }
            else if (thu.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Kim);
            }
            else if (dong.Contains(dc.Ten))
            {
                dc.AddThuocTinh(thuocTinh, NguHanhEnum.Thuy);
            }
        }
Esempio n. 3
0
        private void CheckNhiHinh()
        {
            var tiId  = this.TuTru.FindIndex(u => u.DiaChi.Ten == ChiEnum.Ti);
            var maoId = this.TuTru.FindIndex(u => u.DiaChi.Ten == ChiEnum.Mao);

            DiaChi ti = null, mao = null;

            if (tiId != -1 && maoId != -1)
            {
                ti  = this.TuTru[tiId].DiaChi;
                mao = this.TuTru[maoId].DiaChi;
                var thuocTinh = Constants.ThuocTinh.NHI_HINH;
                ti.AddThuocTinh(thuocTinh, Constants.DiaChiTuongHinh.NHI_HINH);
                mao.AddThuocTinh(thuocTinh, Constants.DiaChiTuongHinh.NHI_HINH);
            }
        }