import java.util.ArrayList;

public class Zocker extends Haendler {
    
  public Zocker(String name){
    super(name);
  }

  @Override
  public ArrayList<Item> handel(Item it) {
    ArrayList<Item> ergebnis = new ArrayList<Item>();
    for (int i = 0;  i < (int) (Math.random() * 3); i++){
      ergebnis.add(zufallsitem());
    }
    return ergebnis;
  }
  
  private Item zufallsitem(){
    switch ((int) (Math.random() * 3)){
      case 0 : {
        return new Pilz();
      }
      case 1 : {
        return new Trank();
      }
    }
    return new Stein();
  }
  
  @Override
  public String toString(){
    return "Zocker " + this.name;
  }
}
