Spritesheet generator for the tortuga game
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.
tortuga-spritegen/src/com/porcupine/mutable/AbstractMutable.java

52 lines
687 B

package com.porcupine.mutable;
/**
* Mutable object
*
* @author Ondřej Hruška (MightyPork)
* @param <T> type
*/
public abstract class AbstractMutable<T> {
/** The wrapped value */
public T o = getDefault();
/**
* Implicint constructor
*/
public AbstractMutable() {}
/**
* new mutable object
*
* @param o value
*/
public AbstractMutable(T o) {
this.o = o;
}
/**
* Get the wrapped value
*
* @return value
*/
public T get() {
return o;
}
/**
* Set value
*
* @param o new value to set
*/
public void set(T o) {
this.o = o;
}
/**
* Get default value
*
* @return default value
*/
protected abstract T getDefault();
}