/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.nplusc.iZc.MazeGame.cells;

import de.nplusc.iZc.MazeGame.Objects.Player;
import java.util.Map;

/**
 *
 * @author LH
 */
public class KeyCell extends MazeCell
{

    public KeyCell(String keyID, Map<Integer, boolean[]> pexits, Map<Integer, boolean[]> pentrances,int bl)
    {
        super(pexits, pentrances,bl,1);
        this.keyID = keyID;
    }
    
    
    public KeyCell(String keyID, Map<Integer, boolean[]> pexits, int bl)
    {
        super(pexits, pexits,bl,1);
        this.keyID = keyID;
    }

    
    
    
    public KeyCell(String keyID)
    {
        this.keyID = keyID;
    }
    
    
    
    private String keyID;

    public String getKeyID()
    {
        return keyID;
    }
    

    public void setKeyID(String keyID)
    {
        this.keyID = keyID;
    }
    
    
    public String onCellEnter(Player p)
    {
        if(p.addKey(keyID))
            return "Schlüssel "+keyID+" gefunden!";
        else
            return "";
    }
}
