package de.fe1k.game9.events;

import de.fe1k.game9.entities.Entity;
import de.nerogar.noise.util.Vector2f;

public class EventEntityMoved implements Event {
	public Entity entity;
	public Vector2f from;
	public Vector2f to;
	public EventEntityMoved(Entity entity, Vector2f from, Vector2f to) {
		this.entity = entity;
		this.from = from;
		this.to = to;
	}

	@Override
	public String toString() {
		return "EventEntityMoved{" +
				"entity=" + entity +
				", from=" + from +
				", to=" + to +
				'}';
	}
}

@@ -102,16 +102,110 @@
 tor2f;%0A%0A
+import java.io.DataInputStream;%0Aimport java.io.DataOutputStream;%0Aimport java.io.IOException;%0A%0A
 public c
@@ -242,19 +242,29 @@
 ts Event
+Networked
  %7B%0A
+%0A
 %09public 
@@ -266,24 +266,26 @@
 blic Entity 
+  
 entity;%0A%09pub
@@ -324,16 +324,50 @@
 r2f to;%0A
+%0A%09public EventEntityMoved() %7B%0A%09%7D%0A%0A
 %09public 
@@ -629,16 +629,16 @@
  + to +%0A
-
 %09%09%09%09'%7D';
@@ -640,11 +640,474 @@
 %09'%7D';%0A%09%7D
+%0A%0A%09@Override%0A%09public void fromStream(DataInputStream in) throws IOException %7B%0A%09%09entity = Entity.getById(in.readLong());%0A%09%09from = new Vector2f(in.readFloat(), in.readFloat());%0A%09%09to = new Vector2f(in.readFloat(), in.readFloat());%0A%09%7D%0A%0A%09@Override%0A%09public void toStream(DataOutputStream out) throws IOException %7B%0A%09%09out.writeLong(entity.getId());%0A%09%09out.writeFloat(from.getX());%0A%09%09out.writeFloat(from.getY());%0A%09%09out.writeFloat(to.getX());%0A%09%09out.writeFloat(to.getY());%0A%09%7D
 %0A%7D%0A

make EventEntityMoved networked (WIP)