Commits

Michael Ludwig  committed 13a96c8

Repair test component definitions given recent changes.

  • Participants
  • Parent commits 98e1f27

Comments (0)

Files changed (20)

File src/test/java/com/googlecode/entreri/component/AbstractComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
 import com.googlecode.entreri.property.ObjectProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public abstract class AbstractComponent extends ComponentData {
-    @Parameter(type=int.class, value="1")
+public abstract class AbstractComponent<T extends AbstractComponent<T>> extends ComponentData<T> {
     private ObjectProperty<Object> property;
     
-    protected AbstractComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
     
     public Object getUserData() {
         return property.getIndexedData()[getIndex()];

File src/test/java/com/googlecode/entreri/component/BadConstructorComponent.java

  * 
  * @author Michael Ludwig
  */
-public class BadConstructorComponent extends ComponentData {
+public class BadConstructorComponent extends ComponentData<BadConstructorComponent> {
     protected BadConstructorComponent(EntitySystem system, int index, Object extraArgument) {
-        super(system, index);
-    }
-
-    @Override
-    protected void init(Object... initParams) throws Exception {
     }
 }

File src/test/java/com/googlecode/entreri/component/BadParametersComponent.java

-/*
- * Entreri, an entity-component framework in Java
- *
- * Copyright (c) 2011, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.googlecode.entreri.component;
-
-import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
-import com.googlecode.entreri.annot.Parameters;
-import com.googlecode.entreri.property.FloatProperty;
-
-/**
- * A test component that uses parameters to reference a non-existent property
- * constructor.
- * 
- * @author Michael Ludwig
- */
-public class BadParametersComponent extends ComponentData {
-    @SuppressWarnings("unused")
-    @Parameters({@Parameter(type=int.class, value="3"),
-                 @Parameter(type=float.class, value="0.3")})
-    private FloatProperty property;
-    
-    protected BadParametersComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
-}

File src/test/java/com/googlecode/entreri/component/ExtraFieldComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
 import com.googlecode.entreri.property.FloatProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public class ExtraFieldComponent extends ComponentData {
+public class ExtraFieldComponent extends ComponentData<ExtraFieldComponent> {
     @SuppressWarnings("unused")
-    @Parameter(type=int.class, value="1")
     private FloatProperty property;
     
     @SuppressWarnings("unused")
     private Object otherField;
-    
-    protected ExtraFieldComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
 }

File src/test/java/com/googlecode/entreri/component/FloatComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
+import com.googlecode.entreri.annot.ElementSize;
 import com.googlecode.entreri.property.FloatProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public class FloatComponent extends ComponentData {
-    @Parameter(type=int.class, value="3")
+public class FloatComponent extends ComponentData<FloatComponent> {
+    @ElementSize(3)
     private FloatProperty property;
     
-    protected FloatComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
     public float getFloat(int offset) {
         int index = getIndex() * 3 + offset;
         return property.getIndexedData()[index];
         int index = getIndex() * 3 + offset;
         property.getIndexedData()[index] = value;
     }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
 }

File src/test/java/com/googlecode/entreri/component/InitParamsComponent.java

-/*
- * Entreri, an entity-component framework in Java
- *
- * Copyright (c) 2011, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.googlecode.entreri.component;
-
-import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.InitParams;
-import com.googlecode.entreri.property.FloatProperty;
-import com.googlecode.entreri.property.ObjectProperty;
-
-@InitParams({float.class, Object.class})
-public class InitParamsComponent extends ComponentData {
-    private FloatProperty floatData;
-    private ObjectProperty<Object> objectData;
-    
-    private InitParamsComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
-    protected void init(Object... initParams) throws Exception {
-        if (initParams[0] == null)
-            throw new NullPointerException("Invalid");
-        
-        floatData.set((Float) initParams[0], getIndex(), 0);
-        objectData.set(initParams[1], getIndex(), 0);
-    }
-    
-    public float getFloat() {
-        return floatData.get(getIndex(), 0);
-    }
-    
-    public Object getObject() {
-        return objectData.get(getIndex(), 0);
-    }
-}

File src/test/java/com/googlecode/entreri/component/IntComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
+import com.googlecode.entreri.annot.ElementSize;
 import com.googlecode.entreri.property.IntProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public class IntComponent extends ComponentData {
-    @Parameter(type=int.class, value="3")
+public class IntComponent extends ComponentData<IntComponent> {
+    @ElementSize(3)
     private IntProperty property;
     
-    protected IntComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
     public int getInt(int offset) {
         int index = getIndex() * 3 + offset;
         return property.getIndexedData()[index];
         int index = getIndex() * 3 + offset;
         property.getIndexedData()[index] = value;
     }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
 }

File src/test/java/com/googlecode/entreri/component/InvalidFactoryComponent.java

+/*
+ * Entreri, an entity-component framework in Java
+ *
+ * Copyright (c) 2011, Michael Ludwig
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ *     Redistributions of source code must retain the above copyright notice,
+ *         this list of conditions and the following disclaimer.
+ *     Redistributions in binary form must reproduce the above copyright notice,
+ *         this list of conditions and the following disclaimer in the
+ *         documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.googlecode.entreri.component;
+
+import com.googlecode.entreri.ComponentData;
+import com.googlecode.entreri.annot.Factory;
+import com.googlecode.entreri.property.FloatPropertyFactory;
+import com.googlecode.entreri.property.IntProperty;
+
+/**
+ * A test component that mis-configures a component so it can't find
+ * the necessary factory() method.
+ * 
+ * @author Michael Ludwig
+ */
+public class InvalidFactoryComponent extends ComponentData<InvalidFactoryComponent> {
+    // use a FloatPropertyFactory for the wrong property type
+    @Factory(FloatPropertyFactory.class)
+    protected IntProperty prop;
+}

File src/test/java/com/googlecode/entreri/component/InvalidFactoryMethodComponent.java

+/*
+ * Entreri, an entity-component framework in Java
+ *
+ * Copyright (c) 2011, Michael Ludwig
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ *     Redistributions of source code must retain the above copyright notice,
+ *         this list of conditions and the following disclaimer.
+ *     Redistributions in binary form must reproduce the above copyright notice,
+ *         this list of conditions and the following disclaimer in the
+ *         documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.googlecode.entreri.component;
+
+import com.googlecode.entreri.ComponentData;
+import com.googlecode.entreri.property.NoFactoryProperty;
+
+/**
+ * A test component that specifies invalid or incorrect factories for
+ * its properties.
+ * 
+ * @author Michael Ludwig
+ */
+public class InvalidFactoryMethodComponent extends ComponentData<InvalidFactoryMethodComponent> {
+    // NoFactoryProperty has no available factory method
+    protected NoFactoryProperty prop;
+}

File src/test/java/com/googlecode/entreri/component/InvalidHierarchyComponent.java

  */
 package com.googlecode.entreri.component;
 
-import com.googlecode.entreri.EntitySystem;
 
 /**
  * A test ComponentData that extends a non-abstract component so it should fail.
  * @author Michael Ludwig
  */
 public class InvalidHierarchyComponent extends FloatComponent {
-    protected InvalidHierarchyComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
+   
 }

File src/test/java/com/googlecode/entreri/component/MultiPropertyComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
+import com.googlecode.entreri.annot.DefaultValue;
+import com.googlecode.entreri.annot.ElementSize;
 import com.googlecode.entreri.annot.Factory;
-import com.googlecode.entreri.annot.Parameter;
-import com.googlecode.entreri.annot.Parameters;
 import com.googlecode.entreri.property.FloatProperty;
 import com.googlecode.entreri.property.FloatPropertyFactory;
-import com.googlecode.entreri.property.MultiParameterProperty;
+import com.googlecode.entreri.property.IntProperty;
+import com.googlecode.entreri.property.LongProperty;
 import com.googlecode.entreri.property.NoParameterProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public class MultiPropertyComponent extends ComponentData {
-    @Parameters({@Parameter(type=int.class, value="2"),
-                 @Parameter(type=float.class, value="0.3")})
-    protected MultiParameterProperty multi;
+public class MultiPropertyComponent extends ComponentData<MultiPropertyComponent> {
+    @DefaultValue(defaultLong=Long.MAX_VALUE)
+    @ElementSize(3)
+    protected LongProperty longProp; // should use factory(int, long)
     
+    @DefaultValue(defaultFloat=0.5f)
+    protected FloatProperty floatProp; // should use factory(1, float)
+    
+    @ElementSize(2)
+    protected IntProperty intProp; // should use factory(int)
+    
+    @Factory(FloatPropertyFactory.class)
+    protected FloatProperty fromFactory; // should create a new FloatPropertyFactory
+    
+    // this should find the createFactory() method
     protected NoParameterProperty noparams;
     
-    @Factory(FloatPropertyFactory.class)
-    protected FloatProperty fromFactory;
-    
-    protected MultiPropertyComponent(EntitySystem system, int index) {
-        super(system, index);
+    public void setLong(long i1, long i2, long i3) {
+        longProp.set(i1, getIndex(), 0);
+        longProp.set(i2, getIndex(), 1);
+        longProp.set(i3, getIndex(), 2);
     }
     
-    public void setFloat(int offset, float f) {
-        multi.setFloat(offset + getIndex() * 2, f);
+    public long[] getLong() {
+        long[] v = new long[] { longProp.get(getIndex(), 0), longProp.get(getIndex(), 1), longProp.get(getIndex(), 2) };
+        return v;
+    }
+    
+    public void setInt(int i1, int i2) {
+        intProp.set(i1, getIndex(), 0);
+        intProp.set(i2, getIndex(), 1);
+    }
+    
+    public int[] getInt() {
+        int[] v = new int[] { intProp.get(getIndex(), 0), intProp.get(getIndex(), 1) };
+        return v;
+    }
+    
+    public void setFloat(float f) {
+        floatProp.set(f, getIndex(), 0);
     }
     
     public float getFloat(int offset) {
-        return multi.getFloat(offset + getIndex() * 2);
+        return floatProp.get(getIndex(), 0);
     }
     
     public NoParameterProperty getCompactProperty() {
     public float getFactoryFloat() {
         return fromFactory.get(getIndex(), 0);
     }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
 }

File src/test/java/com/googlecode/entreri/component/NoFactoryMethodComponent.java

+/*
+ * Entreri, an entity-component framework in Java
+ *
+ * Copyright (c) 2011, Michael Ludwig
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ *     Redistributions of source code must retain the above copyright notice,
+ *         this list of conditions and the following disclaimer.
+ *     Redistributions in binary form must reproduce the above copyright notice,
+ *         this list of conditions and the following disclaimer in the
+ *         documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.googlecode.entreri.component;
+
+import com.googlecode.entreri.ComponentData;
+import com.googlecode.entreri.annot.ElementSize;
+import com.googlecode.entreri.property.TwoParameterProperty;
+
+/**
+ * A test component that specifies invalid or incorrect factories for
+ * its properties.
+ * 
+ * @author Michael Ludwig
+ */
+public class NoFactoryMethodComponent extends ComponentData<NoFactoryMethodComponent> {
+    // TwoParameterProperty also requires a default value, which is not provided
+    @ElementSize(2)
+    protected TwoParameterProperty prop;
+}

File src/test/java/com/googlecode/entreri/component/ObjectComponent.java

  */
 package com.googlecode.entreri.component;
 
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
+import com.googlecode.entreri.annot.ElementSize;
 import com.googlecode.entreri.property.ObjectProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public class ObjectComponent extends AbstractComponent {
-    @Parameter(type=int.class, value="3")
+public class ObjectComponent extends AbstractComponent<ObjectComponent> {
+    @ElementSize(3)
     private ObjectProperty<Object> property;
     
-    protected ObjectComponent(EntitySystem system, int index) {
-        super(system, index);
+    protected ObjectComponent() {
     }
     
     public Object getObject(int offset) {
         int index = getIndex() * 3 + offset;
         property.getIndexedData()[index] = value;
     }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
 }

File src/test/java/com/googlecode/entreri/component/PublicConstructorComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
 
 /**
  * A ComponentData definition with a public constructor.
  * 
  * @author Michael Ludwig
  */
-public class PublicConstructorComponent extends ComponentData {
+public class PublicConstructorComponent extends ComponentData<PublicConstructorComponent> {
 
-    public PublicConstructorComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
+    public PublicConstructorComponent() { }
 }

File src/test/java/com/googlecode/entreri/component/PublicPropertyComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
-import com.googlecode.entreri.annot.Parameter;
 import com.googlecode.entreri.property.FloatProperty;
 
 /**
  * 
  * @author Michael Ludwig
  */
-public class PublicPropertyComponent extends ComponentData {
-    @Parameter(type=int.class, value="1")
+public class PublicPropertyComponent extends ComponentData<PublicPropertyComponent> {
     public FloatProperty property;
-    
-    protected PublicPropertyComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-    
-    @Override
-    protected void init(Object... initParams) throws Exception {
-    }
 }

File src/test/java/com/googlecode/entreri/component/UnmanagedFieldComponent.java

 package com.googlecode.entreri.component;
 
 import com.googlecode.entreri.ComponentData;
-import com.googlecode.entreri.EntitySystem;
 import com.googlecode.entreri.annot.Unmanaged;
 import com.googlecode.entreri.property.ObjectProperty;
 
-public class UnmanagedFieldComponent extends ComponentData {
+public class UnmanagedFieldComponent extends ComponentData<UnmanagedFieldComponent> {
     private transient ObjectProperty<Object> transientProperty;
     
     @Unmanaged
     private transient float field;
-    
-    protected UnmanagedFieldComponent(EntitySystem system, int index) {
-        super(system, index);
-    }
-
-    @Override
-    protected void init(Object... initParams) throws Exception {
-        
-    }
 
     public void setObject(Object v) {
         transientProperty.set(v, getIndex(), 0);

File src/test/java/com/googlecode/entreri/property/MultiParameterProperty.java

-/*
- * Entreri, an entity-component framework in Java
- *
- * Copyright (c) 2011, Michael Ludwig
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- *     Redistributions of source code must retain the above copyright notice,
- *         this list of conditions and the following disclaimer.
- *     Redistributions in binary form must reproduce the above copyright notice,
- *         this list of conditions and the following disclaimer in the
- *         documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.googlecode.entreri.property;
-
-import com.googlecode.entreri.property.FloatProperty;
-import com.googlecode.entreri.property.IndexedDataStore;
-import com.googlecode.entreri.property.Property;
-
-public class MultiParameterProperty implements Property {
-    private final FloatProperty property;
-    
-    public MultiParameterProperty(int elementCount, float unused) {
-        property = new FloatProperty(elementCount);
-    }
-    
-    @Override
-    public IndexedDataStore getDataStore() {
-        return property.getDataStore();
-    }
-
-    @Override
-    public void setDataStore(IndexedDataStore store) {
-        property.setDataStore(store);
-    }
-    
-    public float getFloat(int offset) {
-        return property.getIndexedData()[offset];
-    }
-    
-    public void setFloat(int offset, float f) {
-        property.getIndexedData()[offset] = f;
-    }
-}

File src/test/java/com/googlecode/entreri/property/NoFactoryProperty.java

+/*
+ * Entreri, an entity-component framework in Java
+ *
+ * Copyright (c) 2011, Michael Ludwig
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ *     Redistributions of source code must retain the above copyright notice,
+ *         this list of conditions and the following disclaimer.
+ *     Redistributions in binary form must reproduce the above copyright notice,
+ *         this list of conditions and the following disclaimer in the
+ *         documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.googlecode.entreri.property;
+
+import com.googlecode.entreri.property.CompactAwareProperty;
+import com.googlecode.entreri.property.IndexedDataStore;
+import com.googlecode.entreri.property.IntProperty;
+
+public class NoFactoryProperty implements CompactAwareProperty {
+    private final IntProperty property;
+    
+    private boolean compacted;
+    
+    public NoFactoryProperty(int size) {
+        property = new IntProperty(size);
+    }
+    
+    // add a 3rd arg so this does not match the method checked
+    public static PropertyFactory<NoFactoryProperty> createFactory(final int size, final int dflt, Object extraArg) {
+        return new AbstractPropertyFactory<NoFactoryProperty>() {
+            @Override
+            public void setDefaultValue(NoFactoryProperty property, int index) {
+                property.property.set(dflt, index, 0);
+            }
+            
+            @Override
+            public NoFactoryProperty create() {
+                return new NoFactoryProperty(size);
+            }
+        };
+    }
+    
+    @Override
+    public IndexedDataStore getDataStore() {
+        return property.getDataStore();
+    }
+
+    @Override
+    public void setDataStore(IndexedDataStore store) {
+        property.setDataStore(store);
+    }
+
+    @Override
+    public void onCompactComplete() {
+        compacted = true;
+    }
+    
+    public boolean wasCompacted() {
+        return compacted;
+    }
+}

File src/test/java/com/googlecode/entreri/property/NoParameterProperty.java

         property = new IntProperty(1);
     }
     
+    public static PropertyFactory<NoParameterProperty> createFactory() {
+        return new AbstractPropertyFactory<NoParameterProperty>() {
+            @Override
+            public void setDefaultValue(NoParameterProperty property, int index) {
+                property.property.set(0, index, 0);
+            }
+            
+            @Override
+            public NoParameterProperty create() {
+                return new NoParameterProperty();
+            }
+        };
+    }
+    
     @Override
     public IndexedDataStore getDataStore() {
         return property.getDataStore();

File src/test/java/com/googlecode/entreri/property/TwoParameterProperty.java

+/*
+ * Entreri, an entity-component framework in Java
+ *
+ * Copyright (c) 2011, Michael Ludwig
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ *     Redistributions of source code must retain the above copyright notice,
+ *         this list of conditions and the following disclaimer.
+ *     Redistributions in binary form must reproduce the above copyright notice,
+ *         this list of conditions and the following disclaimer in the
+ *         documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.googlecode.entreri.property;
+
+import com.googlecode.entreri.property.CompactAwareProperty;
+import com.googlecode.entreri.property.IndexedDataStore;
+import com.googlecode.entreri.property.IntProperty;
+
+public class TwoParameterProperty implements CompactAwareProperty {
+    private final IntProperty property;
+    
+    private boolean compacted;
+    
+    public TwoParameterProperty(int size) {
+        property = new IntProperty(size);
+    }
+    
+    public static PropertyFactory<TwoParameterProperty> createFactory(final int size, final int dflt) {
+        return new AbstractPropertyFactory<TwoParameterProperty>() {
+            @Override
+            public void setDefaultValue(TwoParameterProperty property, int index) {
+                property.property.set(dflt, index, 0);
+            }
+            
+            @Override
+            public TwoParameterProperty create() {
+                return new TwoParameterProperty(size);
+            }
+        };
+    }
+    
+    @Override
+    public IndexedDataStore getDataStore() {
+        return property.getDataStore();
+    }
+
+    @Override
+    public void setDataStore(IndexedDataStore store) {
+        property.setDataStore(store);
+    }
+
+    @Override
+    public void onCompactComplete() {
+        compacted = true;
+    }
+    
+    public boolean wasCompacted() {
+        return compacted;
+    }
+}