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.
35 lines
569 B
35 lines
569 B
11 years ago
|
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();
|
||
|
}
|
||
|
|
||
|
}
|