diff --git a/src/mightypork/gamecore/control/timing/Poller.java b/src/mightypork/gamecore/control/timing/Poller.java index 2a8996b..3e849ec 100644 --- a/src/mightypork/gamecore/control/timing/Poller.java +++ b/src/mightypork/gamecore/control/timing/Poller.java @@ -4,11 +4,9 @@ package mightypork.gamecore.control.timing; import java.util.LinkedHashSet; import java.util.Set; -import mightypork.utils.math.constraints.RectCache; - /** - * Used to poll a number of {@link Pollable}s, such as {@link RectCache} + * Used to poll a number of {@link Pollable}s * * @author MightyPork */ diff --git a/src/mightypork/utils/math/constraints/num/Num.java b/src/mightypork/utils/math/constraints/num/Num.java index ec33a94..9d321ca 100644 --- a/src/mightypork/utils/math/constraints/num/Num.java +++ b/src/mightypork/utils/math/constraints/num/Num.java @@ -7,12 +7,17 @@ import mightypork.utils.math.Calc; public abstract class Num implements NumBound { - static final double CMP_EPSILON = 0.0000001; - public static final NumConst ZERO = Num.make(0); public static final NumConst ONE = Num.make(1); + @FactoryMethod + public static Num make(NumBound bound) + { + return new NumBoundAdapter(bound); + } + + @FactoryMethod public static NumConst make(double value) { diff --git a/src/mightypork/utils/math/constraints/num/NumBoundAdapter.java b/src/mightypork/utils/math/constraints/num/NumBoundAdapter.java index d1f6729..b3ddde7 100644 --- a/src/mightypork/utils/math/constraints/num/NumBoundAdapter.java +++ b/src/mightypork/utils/math/constraints/num/NumBoundAdapter.java @@ -9,6 +9,15 @@ public class NumBoundAdapter extends NumAdapter implements PluggableNumBound { private NumBound backing = null; + public NumBoundAdapter() { + } + + + public NumBoundAdapter(NumBound bound) { + backing = bound; + } + + @Override public void setNum(NumBound rect) { diff --git a/src/mightypork/utils/math/constraints/rect/Rect.java b/src/mightypork/utils/math/constraints/rect/Rect.java index 989b28d..917f0ff 100644 --- a/src/mightypork/utils/math/constraints/rect/Rect.java +++ b/src/mightypork/utils/math/constraints/rect/Rect.java @@ -36,6 +36,13 @@ public abstract class Rect implements RectBound { } + @FactoryMethod + public static Rect make(RectBound bound) + { + return new RectBoundAdapter(bound); + } + + @FactoryMethod public static Rect make(Num x, Num y, Num width, Num height) { diff --git a/src/mightypork/utils/math/constraints/rect/RectBoundAdapter.java b/src/mightypork/utils/math/constraints/rect/RectBoundAdapter.java index 6d2a911..fac045b 100644 --- a/src/mightypork/utils/math/constraints/rect/RectBoundAdapter.java +++ b/src/mightypork/utils/math/constraints/rect/RectBoundAdapter.java @@ -10,11 +10,20 @@ import mightypork.utils.math.constraints.RectBound; * * @author MightyPork */ -public abstract class RectBoundAdapter extends RectAdapter implements PluggableRectBound { +public class RectBoundAdapter extends RectAdapter implements PluggableRectBound { private RectBound backing = null; + public RectBoundAdapter() { + } + + + public RectBoundAdapter(RectBound bound) { + backing = bound; + } + + @Override public void setRect(RectBound rect) { diff --git a/src/mightypork/utils/math/constraints/vect/Vect.java b/src/mightypork/utils/math/constraints/vect/Vect.java index 0954a6b..a739c9c 100644 --- a/src/mightypork/utils/math/constraints/vect/Vect.java +++ b/src/mightypork/utils/math/constraints/vect/Vect.java @@ -35,6 +35,13 @@ public abstract class Vect implements VectBound { } + @FactoryMethod + public static Vect make(VectBound bound) + { + return new VectBoundAdapter(bound); + } + + @FactoryMethod public static VectConst make(NumConst xc, NumConst yc) { diff --git a/src/mightypork/utils/math/constraints/vect/VectBoundAdapter.java b/src/mightypork/utils/math/constraints/vect/VectBoundAdapter.java index cf394b1..5eed2db 100644 --- a/src/mightypork/utils/math/constraints/vect/VectBoundAdapter.java +++ b/src/mightypork/utils/math/constraints/vect/VectBoundAdapter.java @@ -10,6 +10,15 @@ public class VectBoundAdapter extends VectAdapter implements PluggableVectBound private VectBound backing = null; + public VectBoundAdapter() { + } + + + public VectBoundAdapter(VectBound bound) { + backing = bound; + } + + @Override public void setVect(VectBound rect) {