public Architect(Chapter inbound) { myChapter = inbound; myChapter.ArchitectCount++; id = myChapter.ArchitectCount; //depth = 0; foreach (Stat thisStat in myChapter.Stats) { currentStats.Add (thisStat, 0); } }
public Page(Chapter inbound) { myChapter = inbound; paraRemaining = myChapter.PlannedParagraphs; while (paraRemaining > 0) { if (myChapter.Rand.Next (0, 4) == 0) { text = (text + PageBreak ()); } else { text = (text + PageBody () + "\n\n"); } paraRemaining--; } }
public void ReceiveStats(Chapter prior) { //Passes the min and max stats from the last chapter to the current chapter. foreach (Stat stat in prior.minStats.Keys) { minStats.Add (stat, prior.minStats[stat]); } foreach (Stat stat in prior.maxStats.Keys) { maxStats.Add (stat, prior.maxStats[stat]); } }
void BuildChapters() { Chapter priorChapter = null; Chapter nextChapter = null; for (int i = 1; i <= PlannedChapters; i++) { Console.WriteLine ("Building chapter " + i + "."); nextChapter = new Chapter (this); if (priorChapter != null) { nextChapter.ReceiveStats (priorChapter); } nextChapter.Build(); chapters.Add (nextChapter); priorChapter = nextChapter; } }