private void realWrite(string str, JsCallback topic = null, bool prompt = false) { foreach (char c in str) { if (c == '\r') { cursorX = 0; } else if (c == '\n') { cursorX = 0; MoveDown(); } else if (c == '\t') { MoveRight(); while (cursorX % 4 > 0) { MoveRight(); } } else { lock (char_array) { char_array[cursorY][cursorX] = new TerminalChar(c, background, foreground, topic, prompt); } MoveRight(); } } }
public TerminalChar(char text, Color background, Color foreground, JsCallback callback = null, bool prompt = false) : base() { this.text = text; this.background = background.Copy(); this.foreground = foreground.Copy(); this.callback = callback; this.prompt = prompt; }
private void SetTopic(int x, int y, JsCallback callback, bool prompt) { if (y >= 0 && x >= 0 && x < width && y < height) { char_array[y][x].callback = callback; char_array[y][x].prompt = prompt; } }