/*
 * 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 MessageCell extends MazeCell
{

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

    public MessageCell(String Message, String MessageID, boolean AddToJournal)
    {
        this.Message = Message;
        this.MessageID = MessageID;
        this.AddToJournal = AddToJournal;
    }
    
    
    
    
    String Message;
    String MessageID;
    boolean AddToJournal;
    
    @Override
    public String onCellEnter(Player p)
    {
        if(!p.getJournalIDs().contains(MessageID)&&AddToJournal);
        {
            p.getJournalTexta().add(Message);
        }
        return Message;
    }
    
}
