Пример #1
0
        public FantasyName GetFantasyName()
        {
            FantasyName name = new FantasyName();

            name.Gender = Gender;

            if (PrefixGenerator != null)
            {
                name.Prefix = PrefixGenerator.GetName();
            }

            if (FirstNameGenerator != null)
            {
                name.FirstName = FirstNameGenerator.GetName();
            }

            if (LastNameGenerator != null)
            {
                name.LastName = LastNameGenerator.GetName();
            }

            if (PostfixNameGenerator != null)
            {
                name.Postfix = PostfixNameGenerator.GetName();
            }

            return(name);
        }
Пример #2
0
        private static IEnumerable <string> GeneratePrefixInformation(PrefixGenerator prefixGenerator)
        {
            var prefixes = prefixGenerator.GetPrefixes().ToArray();

            // if no prefixes, return an empty prefix to get everything
            if (!prefixes.Any())
            {
                return new[] { string.Empty }
            }
            ;

            return(prefixes);
        }