private static void DrawGUI() { cgui.DrawBox(); cgui.CenterTextAt(topRow, "Testa dig själv"); cgui.PrintAt(14, StatsRow, "Grund : 0% "); cgui.PrintAt(54, StatsRow, "Avancerad : 0% "); cgui.PrintAt(95, StatsRow, "Ninja : % "); cgui.CenterTextAt(27, "Totalt : % ", true); cgui.DrawPillar(cgui.MaxWidth / 3, StatsRow - 2, 21); cgui.DrawPillar(2 * (cgui.MaxWidth / 3), StatsRow - 2, 21); }
private static int DoCheckBox(int v) { var gui = new ConsoleGUI(); gui.PrintAt(NiceDebug.StartX - 4, NiceDebug.StartY - 1, v == 0 ? "[ ]" : "[X]"); return(v); }
/// <summary> /// Rita en checkbox, ifylld om uppgiften är OK. /// </summary> /// <param name="text">Texten<see cref="int"/>.</param> /// <returns>Värde att utvärdera<see cref="int"/>.</returns> private static int DoCheckBox(int text) { ConsoleGUI gui = new ConsoleGUI(); gui.PrintAt(NiceDebug.StartX - 4, NiceDebug.StartY - 1, text == 0 ? "[ ]" : "[X]"); return(text); }
/// <summary> /// Mainmetoden. /// </summary> private static void Main() { DrawGUI(); StringBuilder result = new System.Text.StringBuilder("\nResultat:"); double g = Checka.Grund(); double a = Checka.Avancerad(); double n = Checka.Ninja(); double s = (g + a + n) / 300; double t = Math.Round(s * 100, 1); cgui.PrintAt(14, statsRow, $"Grund : {g}% "); cgui.PrintAt(54, statsRow, $"Avancerad : {a}% "); cgui.PrintAt(95, statsRow, $"Ninja : {n}% "); cgui.CenterTextAt(27, $"Totalt : {t}% ", true); cgui.SetPos(0, 0); Console.ReadLine(); }
public static void DebugThis(string text) { var gui = new ConsoleGUI(); if (text.Length > MaxLength) { text = text.Substring(0, MaxLength); } gui.PrintAt(StartX, StartY++, text); }