package com.tutego.exercise.pokopetto.cuno;

import java.util.Scanner;

public class PokopettoGame {
  public static void main( String[] args ) {
    Pokopetto pokopetto = new Pokopetto();

    while ( ! pokopetto.isDead() ) {
      System.out.println( pokopetto );
      System.out.println( "Choose an action: feed, play, sleep, or quit" );
      String action = new Scanner( System.in ).nextLine().toLowerCase();

      switch ( action ) {
        case "feed" -> pokopetto.feed();
        case "play" -> pokopetto.play();
        case "sleep" -> pokopetto.sleep();
        case "quit" -> {
          System.out.println( "Goodbye!" );
          return;
        }
        default -> System.out.println( "Invalid action. Try again." );
      }
    }

    System.out.println( "Pokopetto is not feeling well! Game over." );
  }
}
