some changes, nothing much
This commit is contained in:
@@ -97,7 +97,7 @@ public class TiledRect extends RectProxy {
|
||||
Log.w("Y coordinate(s) out of range.", new IllegalAccessException());
|
||||
}
|
||||
|
||||
Vect orig = origin().add(perCol.mul(x), perRow.mul(y));
|
||||
final Vect orig = origin().add(perCol.mul(x), perRow.mul(y));
|
||||
|
||||
return Rect.make(orig, perCol.mul(size_x), perRow.mul(size_y));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class RectDigest {
|
||||
|
||||
|
||||
public RectDigest(Rect rect)
|
||||
{
|
||||
{
|
||||
this.x = rect.origin().x();
|
||||
this.y = rect.origin().y();
|
||||
|
||||
|
||||
@@ -4,11 +4,10 @@ package mightypork.util.control.timing;
|
||||
import mightypork.util.annotations.DefaultImpl;
|
||||
import mightypork.util.constraints.num.Num;
|
||||
import mightypork.util.constraints.num.mutable.NumAnimated;
|
||||
import mightypork.util.constraints.num.proxy.NumBound;
|
||||
import mightypork.util.math.Easing;
|
||||
|
||||
|
||||
public abstract class Animator implements Updateable, Pauseable, NumBound {
|
||||
public abstract class Animator extends Num implements Updateable, Pauseable {
|
||||
|
||||
private final NumAnimated animator;
|
||||
private final Num num;
|
||||
@@ -81,12 +80,6 @@ public abstract class Animator implements Updateable, Pauseable, NumBound {
|
||||
|
||||
|
||||
@Override
|
||||
public final Num getNum()
|
||||
{
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
public final double value()
|
||||
{
|
||||
return num.value();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mightypork.util.files.ion;
|
||||
|
||||
|
||||
import mightypork.util.files.ion.templates.IonizableHashMap;
|
||||
import mightypork.util.files.ion.templates.StreamableHashMap;
|
||||
|
||||
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ import mightypork.util.files.ion.templates.IonizableHashMap;
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class IonBundle extends IonizableHashMap<String, Object> {
|
||||
public class IonBundle extends StreamableHashMap<String, Object> implements Ionizable {
|
||||
|
||||
/**
|
||||
* Get an object. If not found, fallback is returned.
|
||||
|
||||
@@ -1,39 +1,19 @@
|
||||
package mightypork.util.files.ion;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
|
||||
/**
|
||||
* Object that can be saved to and loaded from Ion file.<br>
|
||||
* All classes implementing Ionizable must be registered to {@link Ion} using
|
||||
* Ion.registerIonizable(obj.class).
|
||||
* <p>
|
||||
* Data object that can be reconstructed by Ion based on it's mark. Such object
|
||||
* MUST provide an implicit constructor.
|
||||
* </p>
|
||||
* <p>
|
||||
* All {@link Ionizable}s must be registered to {@link Ion}, otherwise they
|
||||
* can't be written/loaded using the mark.
|
||||
* </p>
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public interface Ionizable {
|
||||
|
||||
/**
|
||||
* Load data from the input stream. Mark has already been read, begin
|
||||
* reading right after it.
|
||||
*
|
||||
* @param in input stream
|
||||
* @throws IOException
|
||||
*/
|
||||
void load(InputStream in) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Store data to output stream. Mark has already been written, begin right
|
||||
* after it.
|
||||
*
|
||||
* @param out Output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
void save(OutputStream out) throws IOException;
|
||||
|
||||
public interface Ionizable extends Streamable {
|
||||
|
||||
/**
|
||||
* Get Ion mark byte.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package mightypork.util.files.ion;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Saveable to a stream.
|
||||
*
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public interface Streamable {
|
||||
|
||||
/**
|
||||
* Load data from the input stream. Must be compatible with the
|
||||
* <code>save</code> method.
|
||||
*
|
||||
* @param in input stream
|
||||
* @throws IOException
|
||||
*/
|
||||
void load(InputStream in) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Store data to output stream.
|
||||
*
|
||||
* @param out Output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
void save(OutputStream out) throws IOException;
|
||||
|
||||
}
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableArrayList<E> extends ArrayList<E> implements Ionizable {
|
||||
public class StreamableArrayList<E> extends ArrayList<E> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableHashMap<K, V> extends HashMap<K, V> implements Ionizable {
|
||||
public class StreamableHashMap<K, V> extends HashMap<K, V> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableHashSet<E> extends HashSet<E> implements Ionizable {
|
||||
public abstract class StreamableHashSet<E> extends HashSet<E> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableLinkedHashMap<K, V> extends LinkedHashMap<K, V> implements Ionizable {
|
||||
public class StreamableLinkedHashMap<K, V> extends LinkedHashMap<K, V> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableLinkedList<E> extends LinkedList<E> implements Ionizable {
|
||||
public class StreamableLinkedList<E> extends LinkedList<E> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.Stack;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableStack<E> extends Stack<E> implements Ionizable {
|
||||
public class StreamableStack<E> extends Stack<E> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
+2
-2
@@ -7,10 +7,10 @@ import java.io.OutputStream;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import mightypork.util.files.ion.Ion;
|
||||
import mightypork.util.files.ion.Ionizable;
|
||||
import mightypork.util.files.ion.Streamable;
|
||||
|
||||
|
||||
public abstract class IonizableTreeSet<E> extends TreeSet<E> implements Ionizable {
|
||||
public class StreamableTreeSet<E> extends TreeSet<E> implements Streamable {
|
||||
|
||||
@Override
|
||||
public void load(InputStream in) throws IOException
|
||||
Reference in New Issue
Block a user