public override void Rij() { Console2.WriteLine("De broemmer is gestolen!", ConsoleColor.Red); }
public override void Rij() { Console2.WriteLine("De auto rijdt...", ConsoleColor.Red); }
public override void Rij() { Console2.WriteLine("De vrachtwagen rijdt...", ConsoleColor.Red); }
public virtual void Rij() { Console2.WriteLine("Het {{voertuig}} rijdt...", ConsoleColor.White, kleur); }
// Parset een Mustache-achtige-template-string (met max. 1 parameter) en print deze op de console // met de parameter in de accentedColor. public static void Write(string str, ConsoleColor basicColor, ConsoleColor accentedColor) { string before = ""; string accented = ""; string after = ""; LexerState ps = LexerState.BEFORE; foreach (char c in str) { switch (ps) { case LexerState.BEFORE: if (c != '{') { before += c; } else { ps = LexerState.FIRST_OPENING_BRACE; } break; case LexerState.FIRST_OPENING_BRACE: if (c == '{') { ps = LexerState.SECOND_OPENING_BRACE; } else { ps = LexerState.BEFORE; before += '{'; before += c; } break; case LexerState.SECOND_OPENING_BRACE: if (c == '}') { ps = LexerState.FIRST_CLOSING_BRACE; } else { ps = LexerState.ACCENTED; accented += c; } break; case LexerState.ACCENTED: if (c == '}') { ps = LexerState.FIRST_CLOSING_BRACE; } else { accented += c; } break; case LexerState.FIRST_CLOSING_BRACE: if (c == '}') { ps = LexerState.SECOND_CLOSING_BRACE; } else { accented += '}'; accented += c; } break; case LexerState.SECOND_CLOSING_BRACE: ps = LexerState.AFTER; after += c; break; case LexerState.AFTER: after += c; break; } } Console2.Write(before, basicColor); Console2.Write(accented, accentedColor); Console2.WriteLine(after, basicColor); }
public static void WriteLine(string str, ConsoleColor color) { Console2.Write(str, color); Console.WriteLine(); }
public static void WriteLine(string str, ConsoleColor basicColor, ConsoleColor accentedColor) { Console2.Write(str, basicColor, accentedColor); }
public void Steel() { Console2.WriteLine("Voertuig werd gestolen door " + naam, ConsoleColor.Yellow); Console2.WriteLine("GAME OVER", ConsoleColor.Green); }