package me.hammerle.supersnuvi.tiles;

import me.hammerle.supersnuvi.entity.Entity;
import me.hammerle.supersnuvi.entity.Hero;
import me.hammerle.supersnuvi.util.CollisionBox;
import me.hammerle.supersnuvi.util.Face;

public class GoalTile extends BaseTile
{
    public GoalTile(String path) 
    {
        super(path);
        super.setCollisionBox(CollisionBox.createScaledBox(0.1, 0.1, 0.9, 0.9));
    }

    @Override
    public void onEntityCollide(Entity ent, int x, int y, Face face) 
    {
        if(ent instanceof Hero)
        {
            ent.getLevel().finishLevel();
        }
    }

    @Override
    public double getRenderOffsetY() 
    {
        return 1;
    } 
}
