Changed a lot of Actions.cs and a few other things to be more easily
extendable.
This commit is contained in:
35
Menu.cs
Normal file
35
Menu.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
public struct Menu
|
||||
{
|
||||
public static void BuildMenu(Character character)
|
||||
{
|
||||
int index = 1;
|
||||
foreach (string action in character.CharacterEnabledActions)
|
||||
{
|
||||
if (action == "Health Potion")
|
||||
{
|
||||
Console.WriteLine($"{index}. {action} ({GameState.Instance.heroPotionsAvailable})");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{index}. {action}");
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
public static void BuildItemsMenu(Character character)
|
||||
{
|
||||
int index = 1;
|
||||
if (character.equipedItems.Any())
|
||||
{
|
||||
Console.WriteLine($"{index}. Unequip {character.equipedItems[0].Description}");
|
||||
index++;
|
||||
}
|
||||
foreach (Item item in GameState.Instance.heroInventory)
|
||||
{
|
||||
Console.WriteLine($"{index}. {item.Description}");
|
||||
index++;
|
||||
}
|
||||
Console.WriteLine($"{index}. Go back");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user