package com.tutego.exercise.pokopetto.kelm;

// Konstruktor
class Pokopetto {

  private static final int INITIAL_HUNGER = 30;  // 0 = satt, 100 = sehr hungrig
  private static final int INITIAL_MOOD = 80;    // 0 = erschöpft, 100 = energiegeladen

  public static String generateRandomName() {
    return "";
  }

  private final String name;
  private int hunger;    // 0 = satt, 100 = sehr hungrig
  private int mood;      // 0 = erschöpft, 100 = energiegeladen

  public Pokopetto() {
    this( generateRandomName(), INITIAL_HUNGER );
  }

  public Pokopetto( String name, int hunger ) {
    this( name, hunger, INITIAL_MOOD );  // Start mit guter Stimmung
  }

  public Pokopetto( String name, int hunger, int mood ) {
    this.name = name;
    this.hunger = clampPercentage( hunger );
    this.mood = clampPercentage( mood );
  }

  // Copy-Konstruktor
  public Pokopetto( Pokopetto other ) {
    this.name = other.name;
    this.hunger = other.hunger;
    this.mood = other.mood;
  }

  private int clampPercentage( int value ) {
    return Math.clamp( value, 0, 100 );
  }
}
