@PooledWeaver public class PolyConstructor extends Component { public float diameter; public PolyConstructor() { this(0); } public PolyConstructor(float diameter) { this.diameter = diameter; } }
@PooledWeaver(forceWeaving=true) @SuppressWarnings("unused") public class PooledAllFields extends Component { private boolean _boolean = true; private char _char = 'a'; private short _short = 1; private int _int = 1; private long _long = 1; private float _float = 1; private double _double = 1; private String _string = "hej"; }
@PooledWeaver public class ReferencePooled extends Component { public String hi = "hi"; public boolean yup = true; public boolean nope = false; public byte byteValue = 0x10; public short shortValue = 20; public int intValue = 30; public long longValue = 1; public float floatValue = -0.222f; public double doubleValue = 1337; public double doubleValue2 = 0; }
@PooledWeaver public class PooledObjectPosition extends Component { public Vec2f vec2 = new Vec2f(0, 0); public PooledObjectPosition xy(float x, float y) { vec2.x = x; vec2.y = y; return this; } @Override public String toString() { return "Position [x=" + vec2.x + ", y=" + vec2.y + "]"; } }
@PooledWeaver public class PooledString extends Component { public String s; }
@PooledWeaver public class PooledPosition extends Component { public float x; public float y; public PooledPosition xy(float x, float y) { this.x = x; this.y = y; return this; } @Override public String toString() { return "Position [x=" + x + ", y=" + y + "]"; } }
@PooledWeaver // class is only used by benchmark... public class PooledStructComponentA extends Component { public float x, y, z; public short something; public boolean flag; public PooledStructComponentA setXyz(float x, float y, float z) { this.x = x; this.y = y; this.z = z; return this; } @Override public String toString() { return "StructComponentA [x=" + x + ", y=" + y + ", z=" + z + ", something=" + something + ", flag=" + flag + "]"; } }
@PooledWeaver public class PooledCollections extends Component { public Array<String> array = new Array<String>();