You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
571 B
40 lines
571 B
package mightypork.rogue.display.constraints;
|
|
|
|
|
|
import mightypork.utils.math.coord.Coord;
|
|
|
|
|
|
public abstract class Constraint implements ConstraintContext {
|
|
|
|
protected ConstraintContext context;
|
|
|
|
|
|
public Constraint(ConstraintContext context) {
|
|
this.context = context;
|
|
}
|
|
|
|
|
|
public void setContext(ConstraintContext context)
|
|
{
|
|
this.context = context;
|
|
}
|
|
|
|
|
|
public ConstraintContext getContext()
|
|
{
|
|
return context;
|
|
}
|
|
|
|
|
|
protected Coord origin()
|
|
{
|
|
return context.getRect().getOrigin();
|
|
}
|
|
|
|
|
|
protected Coord size()
|
|
{
|
|
return context.getRect().getSize();
|
|
}
|
|
|
|
}
|
|
|