public Destiny(Season env) { this.Year = env.Year; this.Month = env.Month; this.Day = env.Day; this.Hour = env.Hour; }
public Destiny(Season env, bool Gender) { this.Year = env.Year; this.Month = env.Month; this.Day = env.Day; this.Hour = env.Hour; this.Gender = Gender; }
public static string GetWuxingAmount(Season environment) { StringBuilder sb = new StringBuilder(); Dictionary<int,float> dictionary = new Dictionary<int, float>(); dictionary.Add(0,0); dictionary.Add(1,0); dictionary.Add(2,0); dictionary.Add(3,0); dictionary.Add(4,0); float[] floats = new float[5]; string temp = "木火土金水"; Amount amount = GetAmount(environment.Year.Stems.Element); dictionary[amount.Type]+=amount.Value; amount = GetAmount(environment.Month.Stems.Element); dictionary[amount.Type]+=amount.Value; amount = GetAmount(environment.Day.Stems.Element); dictionary[amount.Type]+=amount.Value; amount = GetAmount(environment.Hour.Stems.Element); dictionary[amount.Type]+=amount.Value; foreach (Amount amount1 in GetAmount(environment.Year.Branch.Element)) { dictionary[amount1.Type]+=amount1.Value; } foreach (Amount amount1 in GetAmount(environment.Month.Branch.Element)) { dictionary[amount1.Type] += amount1.Value; } foreach (Amount amount1 in GetAmount(environment.Day.Branch.Element)) { dictionary[amount1.Type] += amount1.Value; } foreach (Amount amount1 in GetAmount(environment.Hour.Branch.Element)) { dictionary[amount1.Type] += amount1.Value; } foreach (KeyValuePair<int, float> keyValuePair in dictionary) { sb.Append(temp[keyValuePair.Key]); sb.Append(" "); sb.Append(keyValuePair.Value); sb.AppendLine(); } return sb.ToString(); }
public static Destiny Parser(string input) { try { string[] ss = input.Trim().Split('|'); Season env = new Season(); env.Year = new Pillar(ss[0]); env.Month = new Pillar(ss[1]); env.Day = new Pillar(ss[2]); env.Hour = new Pillar(ss[3]); //Destiny.))) return env.CreateDestiny(); } catch (Exception ex) { throw; } }