Base of Constraints system.

This commit is contained in:
Ondřej Hruška
2014-03-30 13:09:19 +02:00
parent 1af5f01520
commit 5c261c4513
8 changed files with 392 additions and 313 deletions
@@ -2,7 +2,6 @@ package mightypork.rogue.display;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import mightypork.rogue.App;
@@ -0,0 +1,34 @@
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();
}
}
@@ -0,0 +1,9 @@
package mightypork.rogue.display.constraints;
import mightypork.utils.math.coord.Coord;
import mightypork.utils.math.coord.Rect;
public interface ConstraintContext {
public Rect getRect();
}