package com.fundynamic.d2tm.game.math;

public class Vector2D<T extends Number> {

    private final T x, y;

    public static Vector2D zero() {
        return new Vector2D(0, 0);
    }

    public Vector2D(T x, T y) {
        this.x = x;
        this.y = y;
    }

    public T getX() {
        return x;
    }

    public T getY() {
        return y;
    }

    public Vector2D<Float> move(float xVelocity, float yVelocity, float speed) {
        float newX = x.floatValue() + (speed * xVelocity);
        float newY = y.floatValue() + (speed * yVelocity);
        return new Vector2D<>(newX, newY);
    }

    public Vector2D<Integer> toInt() {
        int newX = x.intValue();
        int newY = y.intValue();
        return new Vector2D<>(newX, newY);
    }
}

@@ -756,11 +756,169 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        return %22Vector2D%7B%22 +%0A                %22x=%22 + x +%0A                %22, y=%22 + y +%0A                '%7D';%0A    %7D
 %0A%7D%0A

Add toString for better logging/output