-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathStartingMenu.cs
33 lines (31 loc) · 951 Bytes
/
StartingMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
namespace Roguelike
{
public class StartingMenu : MenuBase
{
public StartingMenu()
{
MenuItems = new List<MenuItem>
{
new MenuItemNewGame(),
new MenuItemResume(),
new MenuItemSettings(),
new MenuItemExit()
};
}
protected override void Print(int offsetX, int offsetY)
{
Console.Clear();
for (int i = 0; i < MenuItems.Count; i++)
{
Console.SetCursorPosition((Console.WindowWidth - MenuItems[i].Name.Length) / 2,
Console.WindowHeight / 2 + i);
if (i == CurIndex)
Console.ForegroundColor = FgColor;
Console.WriteLine(MenuItems[i].Name);
Console.ResetColor();
}
}
}
}