Пример #1
0
        public Novel(Prosebreaker inbound)
        {
            rand           = new Random();
            words          = inbound.Words;
            firstWords     = inbound.FirstWords;
            crossReference = inbound.CrossReference;
            grammars       = inbound.Grammars;
            string statReport = "";
            int    charCount  = 0;

            Console.WriteLine("Building a novel.");

            foreach (DiscoveredChar thisChar in inbound.DiscoveredChars.Values)
            {
                thisChar.ResolvePronouns();
            }

            characters.AddRange(inbound.DiscoveredChars.Values);

            foreach (DiscoveredChar thisChar in characters)
            {
                charCount++;
                thisChar.Number = charCount;
            }

            for (int i = 0; i < 4; i++)
            {
                charCount++;
                characters.Add(new Character(charCount));
            }

            for (int i = 0; i < 4; i++)
            {
                bool duplicate = false;
                Stat stat;

                stat = new Stat(crossReference [Vocabulary.SpeechPart.Adjective], rand);

                foreach (Stat thisStat in stats)
                {
                    if (stat.Name == thisStat.Name)
                    {
                        duplicate = true;
                    }
                }

                if (!duplicate)
                {
                    stats.Add(stat);
                    if (stat.Opposed == null)
                    {
                        statReport = (statReport + stat.Name + " ");
                    }
                    else
                    {
                        statReport = (statReport + stat.Name + " (vs " + stat.Opposed + ") ");
                    }
                }
            }
        }
Пример #2
0
		public Novel (Prosebreaker inbound) {
			rand = new Random ();
			words = inbound.Words;
			firstWords = inbound.FirstWords;
			crossReference = inbound.CrossReference;
			grammars = inbound.Grammars;
			string statReport = "";
			int charCount = 0;

			Console.WriteLine ("Building a novel.");

			foreach (DiscoveredChar thisChar in inbound.DiscoveredChars.Values) {
				thisChar.ResolvePronouns ();
			}

			characters.AddRange (inbound.DiscoveredChars.Values);

			foreach (DiscoveredChar thisChar in characters) {
				charCount++;
				thisChar.Number = charCount;
			}

			for (int i = 0; i < 4; i++) {
				charCount++;
				characters.Add (new Character (charCount));
			}

			for (int i = 0; i < 4; i++) {
				bool duplicate = false;
				Stat stat;

				stat = new Stat (crossReference [Vocabulary.SpeechPart.Adjective], rand);

				foreach (Stat thisStat in stats) {
					if (stat.Name == thisStat.Name) {
						duplicate = true;
					}
				}

				if (!duplicate) {
					stats.Add (stat);
					if (stat.Opposed == null) {
						statReport = (statReport + stat.Name + " ");
					}
					else {
						statReport = (statReport + stat.Name + " (vs " + stat.Opposed + ") ");
					}
				}
			}
		}
Пример #3
0
        public static void Main()
        {
            string outputPath = @"choicescript-master\web\mygame\scenes";
            //string dictPath = "smalldict.i";
            string dictPath = @"mpos\mobyposi.i";
            Prosebreaker breaker;
            Novel novel;
            Outline outline;

            breaker = new Prosebreaker (dictPath);
            breaker.BreakProse ("sample.txt");

            novel = new Novel (breaker);

            outline = new Outline (novel);

            outline.Build ();

            outline.WriteFiles(outputPath);
        }
Пример #4
0
        public static void Main()
        {
            string outputPath = @"choicescript-master\web\mygame\scenes";
            //string dictPath = "smalldict.i";
            string       dictPath = @"mpos\mobyposi.i";
            Prosebreaker breaker;
            Novel        novel;
            Outline      outline;

            breaker = new Prosebreaker(dictPath);
            breaker.BreakProse("sample.txt");

            novel = new Novel(breaker);

            outline = new Outline(novel);

            outline.Build();

            outline.WriteFiles(outputPath);
        }