Ejemplo n.º 1
0
        private void InitializeSyllables()
        {
            nameSyllables = new RandomDistribution<string>();

            var longSyllables = new StringCombinator();
            longSyllables.AddSet("b", "d", "g", "n", "r", "t");
            longSyllables.AddSet("o", "u");
            longSyllables.AddSet("f", "g", "l", "k", "m", "n", "s", "r");

            foreach (var s in longSyllables.Enumerate())
            {
                if (s.StartsWith("f") || s.StartsWith("s"))
                    nameSyllables.Set(s, 0.4);
                else
                    nameSyllables.Set(s, 1.0);
            }

            var shortSyllables = new StringCombinator();
            shortSyllables.AddSet("a", "i", "e", "o", "u");
            shortSyllables.AddSet("f", "g", "l", "k", "m", "n", "s", "r");

            foreach (var s in shortSyllables.Enumerate())
            {
                if (s.EndsWith("f") || s.EndsWith("s"))
                    nameSyllables.Set(s, 1.0);
                else
                    nameSyllables.Set(s, 3.5);
            }
        }
Ejemplo n.º 2
0
        private void InitializeLengths()
        {
            nameLengths = new RandomDistribution<int>();

            nameLengths.Set(2, 0.70);
            nameLengths.Set(3, 0.29);
            nameLengths.Set(4, 0.01);
        }
Ejemplo n.º 3
0
        private void InitializeTitles()
        {
            titleBearing = new RandomDistribution<bool>();
            titleBearing.Set(true, 0.2);
            titleBearing.Set(false, 0.8);

            var monikers = new StringCombinator();
            monikers.AddSet("rock", "stone", "mountain", "ale", "battle", "axe", "hammer", "shield", "blood", "iron", "steel");
            monikers.AddSet("smasher", "climber", "hunter", "drinker", "seeker", "bearer", "cracker", "thirsty", "fist", "head", "skin", "foot", "beard");

            titles = new RandomDistribution<string>();

            foreach (var m in monikers.Enumerate())
                titles.Set(string.Concat("the ", m.Capitalize()), 1.0);
        }