Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
 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 ();
 }
Ejemplo n.º 3
0
 public Vowel(Random rand)
 {
     this.Val = Vowel.NewVowel(rand);
 }