package de.samdev.colorrunner.game.world.entities.gameentities.floor;

import de.samdev.colorrunner.game.world.CRGameWorld;
import de.samdev.colorrunner.game.world.SwipeDirection;
import de.samdev.colorrunner.game.world.entities.CRGameEntity;
import de.samdev.colorrunner.game.world.entities.StaticEntity;
import de.samdev.colorrunner.game.world.entities.gameentities.PlayerEntity;

public abstract class FloorTileEntity extends StaticEntity {
	public final static float FLOORTILE_WIDTH = 32;
	public final static float FLOORTILE_HEIGHT = 32;

	public FloorTileEntity(CRGameWorld _owner, float x, float y) {
		super(_owner, x, y, FLOORTILE_WIDTH, FLOORTILE_HEIGHT);
	}

	@Override
	public void update(float delta) {
		if (bounds.x < world.camViewBoundaries.x - 512)
			remove();
	}
	
	@Override
	public boolean canCollide(boolean actualCollision, CRGameEntity collider) {
		if (collider instanceof PlayerEntity && (((PlayerEntity)collider).getPhase() == getPhase() || getPhase() == null))
			return true;
		else
			return false;
	}
	
	public abstract SwipeDirection getPhase();
}
