#nullable enable
using System;
namespace Swan {
///
/// A console terminal helper to create nicer output and receive input from the user
/// This class is thread-safe :).
///
public static partial class Terminal {
///
/// Writes the specified text in the given color.
///
/// The text.
/// The color.
/// The writer flags.
// [Obsolete("NEED", false)]
public static void Write(String? text, ConsoleColor? color = null, TerminalWriters writerFlags = TerminalWriters.StandardOutput) {
if(text == null) {
return;
}
lock(SyncLock) {
Byte[] buffer = OutputEncoding.GetBytes(text);
OutputContext context = new OutputContext {
OutputColor = color ?? Settings.DefaultColor,
OutputText = OutputEncoding.GetChars(buffer),
OutputWriters = writerFlags,
};
EnqueueOutput(context);
}
}
}
}