package com.artemis.component;

import com.artemis.Entity;
import com.artemis.PackedComponent;
import com.artemis.util.Vec2f;

@SuppressWarnings("unused")
public class TransPackedFloatReferencel extends PackedComponent {

	private int $offset;
	private static final int $_SIZE_OF = 2;
	private static float[] $data = new float[64];
	

	@Override
	protected PackedComponent forEntity(Entity e) {
		this.$offset = $_SIZE_OF * e.getId();
		if (($data.length - 1) <= $offset) $grow();
		return this;
	}

	@Override
	protected void reset() {
		$data[$offset + 0] = 0;
		$data[$offset + 1] = 0;
	}
	
	private static void $grow()
	{
		float[] old = $data;
		$data = new float[(old.length * 2)];
		System.arraycopy(old, 0, $data, 0, old.length);
	}
	
	public float x() {
		return $data[$offset + 0];
	}
	
	public float y() {
		return $data[$offset + 1];
	}
	
	public TransPackedFloatReferencel x(float value) {
		$data[$offset + 0] = value;
		return this;
	}
	
	public TransPackedFloatReferencel addX(float value) {
		$data[$offset + 0] += value;
		return this;
	}
	
	public TransPackedFloatReferencel y(float value) {
		$data[$offset + 1] = value;
		return this;
	}
	
	public TransPackedFloatReferencel addY(float value) {
		$data[$offset + 1] += value;
		return this;
	}
	
	public TransPackedFloatReferencel add(float x, float y) {
		$data[$offset + 0] += x;
		$data[$offset + 1] += y;
		return this;
	}
	
	
	public TransPackedFloatReferencel set(Vec2f v) {
		$data[$offset + 0] = v.x();
		$data[$offset + 1] = v.y;
		return this;
	}
	
	public TransPackedFloatReferencel add(Vec2f v) {
		$data[$offset + 0] += v.x();
//		$data[$offset + 1] += v.y;
		return this;
	}
	
	public TransPackedFloatReferencel sub(Vec2f v) {
		$data[$offset + 0] -= v.x();
		$data[$offset + 1] -= v.y;
		return this;
	}
	
	public TransPackedFloatReferencel scl(Vec2f v) {
		$data[$offset + 0] *= v.x();
		$data[$offset + 1] *= v.y;
		return this;
	}
}

@@ -856,34 +856,12 @@
 lic 
-TransPackedFloatReferencel
+void
  x(f
@@ -936,747 +936,98 @@
 lic 
-TransPackedFloatReferencel addX(float value) %7B%0A%09%09$data%5B$offset + 0%5D += value;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public TransPackedFloatReferencel y(float value) %7B%0A%09%09$data%5B$offset + 1%5D = value;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public TransPackedFloatReferencel addY(float value) %7B%0A%09%09$data%5B$offset + 1%5D += value;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public TransPackedFloatReferencel add(float x, float y) %7B%0A%09%09$data%5B$offset + 0%5D += x;%0A%09%09$data%5B$offset + 1%5D += y;%0A%09%09return this;%0A%09%7D%0A%09%0A%09%0A%09public TransPackedFloatReferencel set(Vec2f v) %7B%0A%09%09$data%5B$offset + 0%5D = v.x();%0A%09%09$data%5B$offset + 1%5D = v.y;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public TransPackedFloatReferencel add(Vec2f v) %7B%0A%09%09$data%5B$offset + 0%5D += v.x();%0A//%09%09$data%5B$offset + 1%5D += v.y;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public TransPackedFloatReferencel sub
+void y(float value) %7B%0A%09%09$data%5B$offset + 1%5D = value;%0A%09%09return this;%0A%09%7D%0A%09%0A%09%0A%09public void set
 (Vec
@@ -1055,17 +1055,16 @@
 et + 0%5D 
--
 = v.x();
@@ -1089,139 +1089,8 @@
  1%5D 
--= v.y;%0A%09%09return this;%0A%09%7D%0A%09%0A%09public TransPackedFloatReferencel scl(Vec2f v) %7B%0A%09%09$data%5B$offset + 0%5D *= v.x();%0A%09%09$data%5B$offset + 1%5D *
 = v.

Update TransPackedFloatReferencel.java