/**
* Contains environment information
*/
package org.samcrow.environment;
import java.awt.Shape;
import java.util.ArrayList;
import java.util.List;
import org.lekan.graphics.SGConstants;
import org.lekan.graphics.SGForegroundColorChange;
import org.lekan.graphics.SGObject;
/**
* Base class for all obstacles
* @author Sam Crow
*
*/
public abstract class Obstacle {
protected int x;
protected int y;
public Obstacle(int inX, int inY){
x = inX;
y = inY;
}
/**
* Determine if a given point collides with, or is contained in, this Obstacle
* @param localX the X-coordinate of the point
* @param localY the Y-coordinate of the point
* @return if the given point collides with this obstacle
*/
public abstract boolean collides(double localX, double localY);
/**
* Determine if a given Shape collides with, or is contained in, this Obstacle
* @param shape the Shape to test
* @return if the given Shape collides with this obstacle
*/
public abstract boolean collides(Shape shape);
/**
* Get the SGObject necessary to draw this Obstacle
* @return the SGObject
*/
public abstract SGObject drawObject();
public List<SGObject> disabledDrawObjects(){
List<SGObject> objects = new ArrayList<SGObject>();
objects.add(new SGForegroundColorChange(SGConstants.COLOR_GRAY_60P));
objects.add(drawObject());
objects.add(new SGForegroundColorChange(SGConstants.COLOR_FG_DEFAULT));
return objects;
}
}