Moved some classes. Added LayoutChangeEvent class.
This commit is contained in:
@@ -5,7 +5,7 @@ import mightypork.gamecore.audio.DeferredAudio;
|
|||||||
import mightypork.gamecore.audio.Volume;
|
import mightypork.gamecore.audio.Volume;
|
||||||
import mightypork.gamecore.control.timing.Pauseable;
|
import mightypork.gamecore.control.timing.Pauseable;
|
||||||
import mightypork.gamecore.control.timing.Updateable;
|
import mightypork.gamecore.control.timing.Updateable;
|
||||||
import mightypork.utils.math.animation.AnimDouble;
|
import mightypork.utils.math.constraints.num.NumAnimated;
|
||||||
|
|
||||||
import org.lwjgl.openal.AL10;
|
import org.lwjgl.openal.AL10;
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ public class LoopPlayer extends BaseAudioPlayer implements Updateable, Pauseable
|
|||||||
private int sourceID = -1;
|
private int sourceID = -1;
|
||||||
|
|
||||||
/** animator for fade in and fade out */
|
/** animator for fade in and fade out */
|
||||||
private final AnimDouble fadeAnim = new AnimDouble(0);
|
private final NumAnimated fadeAnim = new NumAnimated(0);
|
||||||
|
|
||||||
private double lastUpdateGain = 0;
|
private double lastUpdateGain = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package mightypork.gamecore.control.bus;
|
package mightypork.gamecore.control.bus;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.concurrent.DelayQueue;
|
import java.util.concurrent.DelayQueue;
|
||||||
import java.util.concurrent.Delayed;
|
import java.util.concurrent.Delayed;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import mightypork.gamecore.control.bus.clients.DelegatingClient;
|
||||||
import mightypork.gamecore.control.bus.events.Event;
|
import mightypork.gamecore.control.bus.events.Event;
|
||||||
import mightypork.gamecore.control.bus.events.types.DelayedEvent;
|
import mightypork.gamecore.control.bus.events.types.DelayedEvent;
|
||||||
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
|
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
|
||||||
@@ -116,7 +118,7 @@ final public class EventBus implements Destroyable {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send based on annotation.
|
* Send based on annotation.clients
|
||||||
*
|
*
|
||||||
* @param event event
|
* @param event event
|
||||||
*/
|
*/
|
||||||
@@ -187,6 +189,16 @@ final public class EventBus implements Destroyable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void sendDirectToChildren(DelegatingClient delegatingClient, Event<?> event)
|
||||||
|
{
|
||||||
|
assertLive();
|
||||||
|
|
||||||
|
if (shallLog(event)) Log.f3("<bus> Di sub " + Log.str(event));
|
||||||
|
|
||||||
|
doDispatch(delegatingClient.getChildClients(), event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send immediately.<br>
|
* Send immediately.<br>
|
||||||
* Should be used for real-time events that require immediate response, such
|
* Should be used for real-time events that require immediate response, such
|
||||||
@@ -201,6 +213,21 @@ final public class EventBus implements Destroyable {
|
|||||||
channels.setBuffering(true);
|
channels.setBuffering(true);
|
||||||
clients.setBuffering(true);
|
clients.setBuffering(true);
|
||||||
|
|
||||||
|
doDispatch(clients, event);
|
||||||
|
|
||||||
|
channels.setBuffering(false);
|
||||||
|
clients.setBuffering(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send to a set of clients
|
||||||
|
*
|
||||||
|
* @param clients clients
|
||||||
|
* @param event event
|
||||||
|
*/
|
||||||
|
private void doDispatch(Collection<Object> clients, Event<?> event)
|
||||||
|
{
|
||||||
boolean sent = false;
|
boolean sent = false;
|
||||||
boolean accepted = false;
|
boolean accepted = false;
|
||||||
|
|
||||||
@@ -218,8 +245,6 @@ final public class EventBus implements Destroyable {
|
|||||||
if (!accepted) Log.e("<bus> Not accepted by any channel: " + Log.str(event));
|
if (!accepted) Log.e("<bus> Not accepted by any channel: " + Log.str(event));
|
||||||
if (!sent && shallLog(event)) Log.w("<bus> Not delivered: " + Log.str(event));
|
if (!sent && shallLog(event)) Log.w("<bus> Not delivered: " + Log.str(event));
|
||||||
|
|
||||||
channels.setBuffering(false);
|
|
||||||
clients.setBuffering(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import java.util.Collection;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client containing child clients
|
* Client containing child clients. According to the contract, if the collection
|
||||||
|
* of clients is ordered, the clients will be served in that order. In any case,
|
||||||
|
* the {@link DelegatingClient} itself will be served beforehand.
|
||||||
*
|
*
|
||||||
* @author MightyPork
|
* @author MightyPork
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package mightypork.gamecore.control.bus.events;
|
||||||
|
|
||||||
|
|
||||||
|
import mightypork.gamecore.control.bus.events.types.ImmediateEvent;
|
||||||
|
import mightypork.gamecore.control.timing.Pollable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intended use is to notify UI component sub-clients that they should poll
|
||||||
|
* their cached constraints.
|
||||||
|
*
|
||||||
|
* @author MightyPork
|
||||||
|
*/
|
||||||
|
@ImmediateEvent
|
||||||
|
public class LayoutChangeEvent implements Event<Pollable> {
|
||||||
|
|
||||||
|
public LayoutChangeEvent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleBy(Pollable handler)
|
||||||
|
{
|
||||||
|
handler.poll();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package mightypork.gamecore.control.bus.events;
|
package mightypork.gamecore.control.bus.events;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import mightypork.gamecore.control.bus.EventBus;
|
|||||||
import mightypork.gamecore.control.bus.clients.ClientHub;
|
import mightypork.gamecore.control.bus.clients.ClientHub;
|
||||||
import mightypork.gamecore.input.InputSystem;
|
import mightypork.gamecore.input.InputSystem;
|
||||||
import mightypork.gamecore.render.DisplaySystem;
|
import mightypork.gamecore.render.DisplaySystem;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
|
|
||||||
|
|
||||||
public abstract class BusEnabledPainter extends SimplePainter implements ClientHub, Component, AppAccess {
|
public abstract class BusEnabledPainter extends SimplePainter implements ClientHub, Component, AppAccess {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ package mightypork.gamecore.gui.components;
|
|||||||
import mightypork.gamecore.control.bus.clients.ToggleableClient;
|
import mightypork.gamecore.control.bus.clients.ToggleableClient;
|
||||||
import mightypork.gamecore.control.interf.Enableable;
|
import mightypork.gamecore.control.interf.Enableable;
|
||||||
import mightypork.gamecore.gui.Hideable;
|
import mightypork.gamecore.gui.Hideable;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package mightypork.gamecore.gui.components;
|
package mightypork.gamecore.gui.components;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.PluggableRectBound;
|
import mightypork.utils.math.constraints.rect.PluggableRectBound;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package mightypork.gamecore.gui.components;
|
package mightypork.gamecore.gui.components;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.rect.RectBoundAdapter;
|
import mightypork.utils.math.constraints.rect.RectBoundAdapter;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import mightypork.gamecore.gui.components.BusEnabledPainter;
|
|||||||
import mightypork.gamecore.gui.components.PluggableRenderable;
|
import mightypork.gamecore.gui.components.PluggableRenderable;
|
||||||
import mightypork.gamecore.gui.components.Renderable;
|
import mightypork.gamecore.gui.components.Renderable;
|
||||||
import mightypork.gamecore.gui.components.SimplePainter;
|
import mightypork.gamecore.gui.components.SimplePainter;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package mightypork.gamecore.gui.components.layout;
|
|||||||
|
|
||||||
import mightypork.gamecore.control.AppAccess;
|
import mightypork.gamecore.control.AppAccess;
|
||||||
import mightypork.gamecore.gui.components.PluggableRenderable;
|
import mightypork.gamecore.gui.components.PluggableRenderable;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.rect.TiledRect;
|
import mightypork.utils.math.constraints.rect.TiledRect;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package mightypork.gamecore.gui.components.layout;
|
|||||||
|
|
||||||
import mightypork.gamecore.control.AppAccess;
|
import mightypork.gamecore.control.AppAccess;
|
||||||
import mightypork.gamecore.gui.components.PluggableRenderable;
|
import mightypork.gamecore.gui.components.PluggableRenderable;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.rect.TiledRect;
|
import mightypork.utils.math.constraints.rect.TiledRect;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import mightypork.gamecore.input.KeyBindingPool;
|
|||||||
import mightypork.gamecore.input.KeyStroke;
|
import mightypork.gamecore.input.KeyStroke;
|
||||||
import mightypork.gamecore.render.Render;
|
import mightypork.gamecore.render.Render;
|
||||||
import mightypork.utils.annotations.DefaultImpl;
|
import mightypork.utils.annotations.DefaultImpl;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import mightypork.gamecore.input.KeyBinder;
|
|||||||
import mightypork.gamecore.input.KeyBindingPool;
|
import mightypork.gamecore.input.KeyBindingPool;
|
||||||
import mightypork.gamecore.input.KeyStroke;
|
import mightypork.gamecore.input.KeyStroke;
|
||||||
import mightypork.utils.annotations.DefaultImpl;
|
import mightypork.utils.annotations.DefaultImpl;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import mightypork.gamecore.control.AppModule;
|
|||||||
import mightypork.gamecore.control.bus.events.ScreenChangeEvent;
|
import mightypork.gamecore.control.bus.events.ScreenChangeEvent;
|
||||||
import mightypork.gamecore.control.timing.FpsMeter;
|
import mightypork.gamecore.control.timing.FpsMeter;
|
||||||
import mightypork.utils.logging.Log;
|
import mightypork.utils.logging.Log;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|
||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import mightypork.gamecore.render.fonts.FontRenderer.Align;
|
|||||||
import mightypork.gamecore.render.fonts.GLFont;
|
import mightypork.gamecore.render.fonts.GLFont;
|
||||||
import mightypork.rogue.Res;
|
import mightypork.rogue.Res;
|
||||||
import mightypork.utils.math.color.RGB;
|
import mightypork.utils.math.color.RGB;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
import mightypork.utils.string.StringProvider;
|
import mightypork.utils.string.StringProvider;
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import mightypork.gamecore.control.bus.events.ScreenChangeEvent;
|
|||||||
import mightypork.gamecore.control.timing.Updateable;
|
import mightypork.gamecore.control.timing.Updateable;
|
||||||
import mightypork.gamecore.gui.components.SimplePainter;
|
import mightypork.gamecore.gui.components.SimplePainter;
|
||||||
import mightypork.gamecore.render.Render;
|
import mightypork.gamecore.render.Render;
|
||||||
import mightypork.utils.math.animation.AnimDouble;
|
import mightypork.utils.math.Easing;
|
||||||
import mightypork.utils.math.animation.Easing;
|
|
||||||
import mightypork.utils.math.color.RGB;
|
import mightypork.utils.math.color.RGB;
|
||||||
|
import mightypork.utils.math.constraints.num.NumAnimated;
|
||||||
import mightypork.utils.math.constraints.num.Num;
|
import mightypork.utils.math.constraints.num.Num;
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ public class BouncyBox extends SimplePainter implements Updateable, ScreenChange
|
|||||||
|
|
||||||
private final Rect box;
|
private final Rect box;
|
||||||
|
|
||||||
private final AnimDouble pos = new AnimDouble(0, Easing.BOUNCE_OUT);
|
private final NumAnimated pos = new NumAnimated(0, Easing.BOUNCE_OUT);
|
||||||
|
|
||||||
|
|
||||||
public BouncyBox() {
|
public BouncyBox() {
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import mightypork.gamecore.input.KeyStroke;
|
|||||||
import mightypork.gamecore.input.Keys;
|
import mightypork.gamecore.input.Keys;
|
||||||
import mightypork.gamecore.render.fonts.FontRenderer.Align;
|
import mightypork.gamecore.render.fonts.FontRenderer.Align;
|
||||||
import mightypork.rogue.Res;
|
import mightypork.rogue.Res;
|
||||||
import mightypork.utils.math.animation.AnimDouble;
|
import mightypork.utils.math.Easing;
|
||||||
import mightypork.utils.math.animation.Easing;
|
|
||||||
import mightypork.utils.math.color.RGB;
|
import mightypork.utils.math.color.RGB;
|
||||||
|
import mightypork.utils.math.constraints.num.NumAnimated;
|
||||||
import mightypork.utils.math.constraints.num.Num;
|
import mightypork.utils.math.constraints.num.Num;
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
@@ -25,7 +25,7 @@ import mightypork.utils.math.constraints.vect.VectAnimated;
|
|||||||
|
|
||||||
public class LayerFlyingCat extends ScreenLayer implements Updateable, MouseButtonEvent.Listener {
|
public class LayerFlyingCat extends ScreenLayer implements Updateable, MouseButtonEvent.Listener {
|
||||||
|
|
||||||
private final AnimDouble size = new AnimDouble(400, Easing.SINE_BOTH);
|
private final NumAnimated size = new NumAnimated(400, Easing.SINE_BOTH);
|
||||||
private final VectAnimated pos = VectAnimated.makeVar(Easing.ELASTIC_OUT);
|
private final VectAnimated pos = VectAnimated.makeVar(Easing.ELASTIC_OUT);
|
||||||
|
|
||||||
private final Random rand = new Random();
|
private final Random rand = new Random();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import mightypork.gamecore.gui.screens.Screen;
|
|||||||
import mightypork.gamecore.gui.screens.ScreenLayer;
|
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||||||
import mightypork.gamecore.render.Render;
|
import mightypork.gamecore.render.Render;
|
||||||
import mightypork.utils.math.color.RGB;
|
import mightypork.utils.math.color.RGB;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
import mightypork.utils.math.constraints.rect.RectBound;
|
||||||
|
|
||||||
|
|
||||||
public class LayerTestGradient extends ScreenLayer {
|
public class LayerTestGradient extends ScreenLayer {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import mightypork.utils.math.animation.Easing;
|
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|
||||||
import org.lwjgl.BufferUtils;
|
import org.lwjgl.BufferUtils;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package mightypork.utils.math.animation;
|
package mightypork.utils.math;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.annotations.FactoryMethod;
|
import mightypork.utils.annotations.FactoryMethod;
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package mightypork.utils.math;
|
package mightypork.utils.math;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.Calc.Deg;
|
|
||||||
import mightypork.utils.math.Calc.Rad;
|
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|
||||||
|
|
||||||
@@ -42,7 +40,7 @@ public class Polar {
|
|||||||
*/
|
*/
|
||||||
public Polar(double angle, boolean deg, double distance) {
|
public Polar(double angle, boolean deg, double distance) {
|
||||||
this.radius = distance;
|
this.radius = distance;
|
||||||
this.angle = deg ? Deg.toRad(angle) : angle;
|
this.angle = deg ? Math.toRadians(angle) : angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -60,7 +58,7 @@ public class Polar {
|
|||||||
*/
|
*/
|
||||||
public double getAngleDeg()
|
public double getAngleDeg()
|
||||||
{
|
{
|
||||||
return Rad.toDeg(angle);
|
return Math.toDegrees(angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -78,7 +76,7 @@ public class Polar {
|
|||||||
*/
|
*/
|
||||||
public void setAngleDeg(double angle)
|
public void setAngleDeg(double angle)
|
||||||
{
|
{
|
||||||
this.angle = Deg.toRad(angle);
|
this.angle = Math.toRadians(angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -1,10 +1,10 @@
|
|||||||
package mightypork.utils.math.animation;
|
package mightypork.utils.math.constraints.num;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.gamecore.control.timing.Pauseable;
|
import mightypork.gamecore.control.timing.Pauseable;
|
||||||
import mightypork.gamecore.control.timing.Updateable;
|
import mightypork.gamecore.control.timing.Updateable;
|
||||||
import mightypork.utils.math.Calc;
|
import mightypork.utils.math.Calc;
|
||||||
import mightypork.utils.math.constraints.num.NumMutable;
|
import mightypork.utils.math.Easing;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,7 +12,7 @@ import mightypork.utils.math.constraints.num.NumMutable;
|
|||||||
*
|
*
|
||||||
* @author MightyPork
|
* @author MightyPork
|
||||||
*/
|
*/
|
||||||
public class AnimDouble extends NumMutable implements Updateable, Pauseable {
|
public class NumAnimated extends NumMutable implements Updateable, Pauseable {
|
||||||
|
|
||||||
/** target double */
|
/** target double */
|
||||||
protected double to = 0;
|
protected double to = 0;
|
||||||
@@ -41,7 +41,7 @@ public class AnimDouble extends NumMutable implements Updateable, Pauseable {
|
|||||||
*
|
*
|
||||||
* @param value initial value
|
* @param value initial value
|
||||||
*/
|
*/
|
||||||
public AnimDouble(double value) {
|
public NumAnimated(double value) {
|
||||||
setTo(value);
|
setTo(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ public class AnimDouble extends NumMutable implements Updateable, Pauseable {
|
|||||||
* @param value initial value
|
* @param value initial value
|
||||||
* @param easing easing function
|
* @param easing easing function
|
||||||
*/
|
*/
|
||||||
public AnimDouble(double value, Easing easing) {
|
public NumAnimated(double value, Easing easing) {
|
||||||
this(value);
|
this(value);
|
||||||
setEasing(easing);
|
setEasing(easing);
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ public class AnimDouble extends NumMutable implements Updateable, Pauseable {
|
|||||||
*
|
*
|
||||||
* @param other other animator
|
* @param other other animator
|
||||||
*/
|
*/
|
||||||
public AnimDouble(AnimDouble other) {
|
public NumAnimated(NumAnimated other) {
|
||||||
setTo(other);
|
setTo(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ public class AnimDouble extends NumMutable implements Updateable, Pauseable {
|
|||||||
*
|
*
|
||||||
* @param other
|
* @param other
|
||||||
*/
|
*/
|
||||||
public void setTo(AnimDouble other)
|
public void setTo(NumAnimated other)
|
||||||
{
|
{
|
||||||
this.from = other.from;
|
this.from = other.from;
|
||||||
this.to = other.to;
|
this.to = other.to;
|
||||||
@@ -314,9 +314,9 @@ public class AnimDouble extends NumMutable implements Updateable, Pauseable {
|
|||||||
* @return copy
|
* @return copy
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AnimDouble clone()
|
public NumAnimated clone()
|
||||||
{
|
{
|
||||||
return new AnimDouble(this);
|
return new NumAnimated(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
+6
-5
@@ -1,7 +1,8 @@
|
|||||||
package mightypork.utils.math.animation;
|
package mightypork.utils.math.constraints.num;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.Calc;
|
import mightypork.utils.math.Calc;
|
||||||
|
import mightypork.utils.math.Easing;
|
||||||
import mightypork.utils.math.Calc.Deg;
|
import mightypork.utils.math.Calc.Deg;
|
||||||
|
|
||||||
|
|
||||||
@@ -10,19 +11,19 @@ import mightypork.utils.math.Calc.Deg;
|
|||||||
*
|
*
|
||||||
* @author MightyPork
|
* @author MightyPork
|
||||||
*/
|
*/
|
||||||
public class AnimDoubleDeg extends AnimDouble {
|
public class NumAnimatedDeg extends NumAnimated {
|
||||||
|
|
||||||
public AnimDoubleDeg(AnimDouble other) {
|
public NumAnimatedDeg(NumAnimated other) {
|
||||||
super(other);
|
super(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AnimDoubleDeg(double value) {
|
public NumAnimatedDeg(double value) {
|
||||||
super(value);
|
super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AnimDoubleDeg(double value, Easing easing) {
|
public NumAnimatedDeg(double value, Easing easing) {
|
||||||
super(value, easing);
|
super(value, easing);
|
||||||
}
|
}
|
||||||
|
|
||||||
+6
-5
@@ -1,7 +1,8 @@
|
|||||||
package mightypork.utils.math.animation;
|
package mightypork.utils.math.constraints.num;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.Calc;
|
import mightypork.utils.math.Calc;
|
||||||
|
import mightypork.utils.math.Easing;
|
||||||
import mightypork.utils.math.Calc.Rad;
|
import mightypork.utils.math.Calc.Rad;
|
||||||
|
|
||||||
|
|
||||||
@@ -10,19 +11,19 @@ import mightypork.utils.math.Calc.Rad;
|
|||||||
*
|
*
|
||||||
* @author MightyPork
|
* @author MightyPork
|
||||||
*/
|
*/
|
||||||
public class AnimDoubleRad extends AnimDouble {
|
public class NumAnimatedRad extends NumAnimated {
|
||||||
|
|
||||||
public AnimDoubleRad(AnimDouble other) {
|
public NumAnimatedRad(NumAnimated other) {
|
||||||
super(other);
|
super(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AnimDoubleRad(double value) {
|
public NumAnimatedRad(double value) {
|
||||||
super(value);
|
super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AnimDoubleRad(double value, Easing easing) {
|
public NumAnimatedRad(double value, Easing easing) {
|
||||||
super(value, easing);
|
super(value, easing);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package mightypork.utils.math.constraints.num;
|
package mightypork.utils.math.constraints.num;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Numeric constraint
|
* Numeric constraint
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package mightypork.utils.math.constraints.num;
|
package mightypork.utils.math.constraints.num;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.PluggableNumBound;
|
|
||||||
|
|
||||||
|
|
||||||
public class NumBoundAdapter extends NumAdapter implements PluggableNumBound {
|
public class NumBoundAdapter extends NumAdapter implements PluggableNumBound {
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
package mightypork.utils.math.constraints;
|
package mightypork.utils.math.constraints.num;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.num.NumBound;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package mightypork.utils.math.constraints;
|
package mightypork.utils.math.constraints.rect;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3,7 +3,6 @@ package mightypork.utils.math.constraints.rect;
|
|||||||
|
|
||||||
import mightypork.utils.annotations.FactoryMethod;
|
import mightypork.utils.annotations.FactoryMethod;
|
||||||
import mightypork.utils.math.constraints.Digestable;
|
import mightypork.utils.math.constraints.Digestable;
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
import mightypork.utils.math.constraints.num.Num;
|
import mightypork.utils.math.constraints.num.Num;
|
||||||
import mightypork.utils.math.constraints.num.NumConst;
|
import mightypork.utils.math.constraints.num.NumConst;
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
import mightypork.utils.math.constraints.vect.Vect;
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
package mightypork.utils.math.constraints;
|
package mightypork.utils.math.constraints.rect;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package mightypork.utils.math.constraints.rect;
|
package mightypork.utils.math.constraints.rect;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.PluggableRectBound;
|
|
||||||
import mightypork.utils.math.constraints.RectBound;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package mightypork.utils.math.constraints;
|
package mightypork.utils.math.constraints.vect;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4,7 +4,6 @@ package mightypork.utils.math.constraints.vect;
|
|||||||
import mightypork.utils.annotations.DefaultImpl;
|
import mightypork.utils.annotations.DefaultImpl;
|
||||||
import mightypork.utils.annotations.FactoryMethod;
|
import mightypork.utils.annotations.FactoryMethod;
|
||||||
import mightypork.utils.math.constraints.Digestable;
|
import mightypork.utils.math.constraints.Digestable;
|
||||||
import mightypork.utils.math.constraints.VectBound;
|
|
||||||
import mightypork.utils.math.constraints.num.Num;
|
import mightypork.utils.math.constraints.num.Num;
|
||||||
import mightypork.utils.math.constraints.num.NumConst;
|
import mightypork.utils.math.constraints.num.NumConst;
|
||||||
import mightypork.utils.math.constraints.rect.Rect;
|
import mightypork.utils.math.constraints.rect.Rect;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ package mightypork.utils.math.constraints.vect;
|
|||||||
import mightypork.gamecore.control.timing.Pauseable;
|
import mightypork.gamecore.control.timing.Pauseable;
|
||||||
import mightypork.gamecore.control.timing.Updateable;
|
import mightypork.gamecore.control.timing.Updateable;
|
||||||
import mightypork.utils.annotations.FactoryMethod;
|
import mightypork.utils.annotations.FactoryMethod;
|
||||||
import mightypork.utils.math.animation.AnimDouble;
|
import mightypork.utils.math.Easing;
|
||||||
import mightypork.utils.math.animation.Easing;
|
import mightypork.utils.math.constraints.num.NumAnimated;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,7 +15,7 @@ import mightypork.utils.math.animation.Easing;
|
|||||||
*/
|
*/
|
||||||
public class VectAnimated extends VectMutable implements Pauseable, Updateable {
|
public class VectAnimated extends VectMutable implements Pauseable, Updateable {
|
||||||
|
|
||||||
private final AnimDouble x, y, z;
|
private final NumAnimated x, y, z;
|
||||||
private double defaultDuration = 0;
|
private double defaultDuration = 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ public class VectAnimated extends VectMutable implements Pauseable, Updateable {
|
|||||||
* @param y y animator
|
* @param y y animator
|
||||||
* @param z z animator
|
* @param z z animator
|
||||||
*/
|
*/
|
||||||
public VectAnimated(AnimDouble x, AnimDouble y, AnimDouble z) {
|
public VectAnimated(NumAnimated x, NumAnimated y, NumAnimated z) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
@@ -41,9 +41,9 @@ public class VectAnimated extends VectMutable implements Pauseable, Updateable {
|
|||||||
* @param easing animation easing
|
* @param easing animation easing
|
||||||
*/
|
*/
|
||||||
public VectAnimated(Vect start, Easing easing) {
|
public VectAnimated(Vect start, Easing easing) {
|
||||||
x = new AnimDouble(start.x(), easing);
|
x = new NumAnimated(start.x(), easing);
|
||||||
y = new AnimDouble(start.y(), easing);
|
y = new NumAnimated(start.y(), easing);
|
||||||
z = new AnimDouble(start.z(), easing);
|
z = new NumAnimated(start.z(), easing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ public class VectAnimated extends VectMutable implements Pauseable, Updateable {
|
|||||||
* @return animated mutable vector
|
* @return animated mutable vector
|
||||||
*/
|
*/
|
||||||
@FactoryMethod
|
@FactoryMethod
|
||||||
public static VectAnimated makeVar(AnimDouble x, AnimDouble y, AnimDouble z)
|
public static VectAnimated makeVar(NumAnimated x, NumAnimated y, NumAnimated z)
|
||||||
{
|
{
|
||||||
return new VectAnimated(x, y, z);
|
return new VectAnimated(x, y, z);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
package mightypork.utils.math.constraints;
|
package mightypork.utils.math.constraints.vect;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.vect.Vect;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package mightypork.utils.math.constraints.vect;
|
package mightypork.utils.math.constraints.vect;
|
||||||
|
|
||||||
|
|
||||||
import mightypork.utils.math.constraints.PluggableVectBound;
|
|
||||||
import mightypork.utils.math.constraints.VectBound;
|
|
||||||
|
|
||||||
|
|
||||||
public class VectBoundAdapter extends VectAdapter implements PluggableVectBound {
|
public class VectBoundAdapter extends VectAdapter implements PluggableVectBound {
|
||||||
|
|||||||
Reference in New Issue
Block a user