Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
756 B
1
Indexable
Never
private void HandleUserInput()
{
    while (true)
    {
        io.WriteLine("Select an option:");
        io.WriteLine("1. Play");
        io.WriteLine("2. Clear Player Data");
        io.WriteLine("3. Exit");

        string choice = io.ReadLine();

        switch (choice)
        {
            case "1":
                Play();
                break;
            case "2":
                playerDataStorage.ClearData();
                io.WriteLine("Player data cleared.");
                break;
            case "3":
                io.WriteLine("Exiting the game...");
                return;
            default:
                io.WriteLine("Invalid option. Please try again.");
                break;
        }
    }
}