private void TestGenerateExcuses(object sender, RoutedEventArgs e)
 {
     for (int i = 0; i < 100; i++)
     {
         Console.WriteLine(NamesGenerator.GenerateName() + " didn't go hunting. He told others that " + NamesGenerator.GenerateLameExcuse());
     }
 }
Beispiel #2
0
 public Tribe(int randomSeed)
 {
     id             = nextFreeId++; // Племена создаются только из майнтрэда
     randomizer     = new Random(seed = randomSeed);
     TribeName      = NamesGenerator.GenerateTribeName();
     keepsLog       = randomizer.Chance(WorldProperties.ChancesThatTribeWillWriteALog);
     yearBegun      = World.Year;
     lastYearActive = yearBegun;
     if (keepsLog)
     {
         logFileName = Path.Combine(World.TribesLogFolder, TribeName + "(" + World.Year);
         File.WriteAllText(logFileName, Properties.Resources.TribeViewerTemplateBeginning);
     }
 }
        private void TestGenerateNames(object sender, RoutedEventArgs e)
        {
            DateTime start = DateTime.Now;

            for (int i = 1; i < 10000001; i++)
            {
                string name = NamesGenerator.GenerateName();

                if (i % 500000 == 0)
                {
                    Console.WriteLine(i + ".\t" + name + "\t" + (DateTime.Now - start).TotalMilliseconds);
                    start = DateTime.Now;
                }
            }
        }