Beispiel #1
0
        public static void Add(MenuComponent _comp)
        {
            if (_comp != null)
            {
                Menu._comp.Add(_comp);
                return;
            }

            Menu._comp.Add(GetComponentByID("ThisParameterWillNotMatchAnyIDInThe_compList:D"));
        }
Beispiel #2
0
        public static void Render()
        {
            goto prepPhase;

            prepPhase:

            selecint = 0;
            goto renPhase;

            renPhase:

            Console.Clear();

            for (int i = 0; i < _comp.Count; i++)
            {
                if (i == selecint)
                    selected = _comp[i];
            }

            for(int i = 0; i < _comp.Count; i++)
            {
                if (_comp[i] == selected)
                    Console.WriteLine("  >  " + _comp[i].Name);

                else
                    Console.WriteLine("     " + _comp[i].Name);
            }

            cki = Console.ReadKey();

            switch (cki.Key)
            {
                case ConsoleKey.UpArrow:
                    if (selecint > 0)
                        selecint--;
                    break;
                case ConsoleKey.DownArrow:
                    if (selecint < _comp.Count)
                        selecint++;
                    break;
                case ConsoleKey.Enter:
                    _comp[selecint].Fire();

                    if (_comp[selecint].willQuitMenu)
                        return;

                    break;
                default:
                    goto renPhase;
            }

            goto renPhase;
        }
Beispiel #3
0
 public static void Remove(MenuComponent _comp)
 {
     Menu._comp.Remove(_comp);
 }