protected string from_pattern(NamePattern.Token[] pattern) { StringBuilder sb = new StringBuilder(); bool first = true; foreach (NamePattern.Token tk in pattern) { if (tk == NamePattern.Token.Consonant) { Consonant c = new Consonant(this.rand); if (first) { sb.Append(c.Val.ToUpper()); first = false; } else { sb.Append(c.Val); } } else { Vowel v = new Vowel(this.rand); sb.Append(v.Val); } } return(sb.ToString()); }
public Consonant(Random rand) { this.Val = Consonant.NewConsonant(rand); }
protected string from_pattern(NamePattern.Token[] pattern) { StringBuilder sb = new StringBuilder (); bool first = true; foreach (NamePattern.Token tk in pattern) { if (tk == NamePattern.Token.Consonant) { Consonant c = new Consonant (this.rand); if (first) { sb.Append (c.Val.ToUpper ()); first = false; } else sb.Append (c.Val); } else { Vowel v = new Vowel (this.rand); sb.Append (v.Val); } } return sb.ToString (); }