/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package worldoffri;

import java.util.HashMap;

/**
 *
 * @author cabbi
 */
public class Hrac {

    private String aMeno;
    private Miestnost aZaciatocnaMiestnost;
    private HashMap<String, Predmet> aInventar;
    private int aZivot;

    public Hrac(String paMeno) {
        aMeno = paMeno;
        aZaciatocnaMiestnost = new Miestnost("terasa - hlavny vstup na fakultu");
        aInventar = new HashMap<String, Predmet>();
        aZivot = 100;

    }

    public String dajMeno() {
        return aMeno;
    }

    public Miestnost kdeZacinas() {
        return aZaciatocnaMiestnost;
    }

    public void vlozDoInventara(Predmet predmet) {
        if (predmet != null) {

            aInventar.put(predmet.dajNazov(), predmet);
        }
        aZivot--;


    }

    public Predmet vyberZInventara(String paPredmet) {
        if (paPredmet == null) {
            paPredmet = "";
        }
        aZivot--;
        return aInventar.remove(paPredmet);
    }

    public void vypisInventar() {
        System.out.println("V batohu máš:" + aInventar.keySet());
    }

    public void prechod() {

        aZivot--;
    }
    
    public int dajZivot() {
        return aZivot;
    }
}
