package me.vrekt.lunar.physics;

import me.vrekt.lunar.world.dir.Direction;

// This can potentially relocate into {project}.world.physics.* if we end up using this solely in World.
/**
 * This object can potentially be passed into World and create custom variable velocity.
 */
public class Velocity {
    private Direction direction;
    private float magnitude;

    /**
     * Creates velocity object based on the direction and magnitude.
     */
    public Velocity(Direction direction, float magnitude) {
        this.direction = direction;
        this.magnitude = magnitude;
    }

    /**
     * Gets the direction velocity is currently pointing at.
     */
    public Direction getDirection() {
        return direction;
    }

    /**
     * Sets the direction that the game's velocity will point at.
     */
    public void setDirection(Direction direction) {
        this.direction = direction;
    }

    /**
     * Gets the acceleration constant of velocity.
     */
    public float getMagnitude() {
        return magnitude;
    }

    /**
     * Sets the magnitude of velocity to something else.
     */
    public void setMagnitude(float magnitude) {
        this.magnitude = magnitude;
    }

    // TODO Add object manipulation functions tha will be executed in loop
}

@@ -37,42 +37,26 @@
 ort 
-me.vrekt.lunar.world.dir.Direc
+java.util.Op
 tion
+al
 ;%0A%0A/
@@ -159,16 +159,17 @@
  World.%0A
+%0A
 /**%0A * T
@@ -259,55 +259,538 @@
 .%0A *
-/%0Apublic class Velocity %7B%0A    private Direction
+%0A * X and Y velocites should be %3Ci%3Eper second%3C/i%3E or %3Ci%3Eper tick%3C/i%3E, we should decide on that perhapes...%0A */%0Apublic class Velocity %7B%0A    // If these optionals are not set then y velocity is not touched. x==0 would be down and y==0 would be left and so on... These velocity values should be absolute and not relative, and should not be update every tick, or decay.%0A    // Technically we can use null but using null to represent something is really icky for me%0A    private Optional%3CDouble%3E directionX;%0A    private Optional%3CDouble%3E
  dir
@@ -791,25 +791,27 @@
 e%3E direction
-;
+Y;%0A
 %0A    private
@@ -890,16 +890,26 @@
 irection
+ (x and y)
  and mag
@@ -944,25 +944,61 @@
 elocity(
-Direction
+Optional%3CDouble%3E directionX, Optional%3CDouble%3E
  directi
@@ -999,16 +999,17 @@
 irection
+Y
 , float 
@@ -1035,32 +1035,33 @@
   this.direction
+X
  = direction;%0A  
@@ -1052,24 +1052,63 @@
  = direction
+X;%0A        this.directionY = directionY
 ;%0A        th
@@ -1168,51 +1168,176 @@
 the 
-direction velocity is currently pointing at
+X component of the velocity.%0A     */%0A    public Optional%3CDouble%3E getDirectionX() %7B%0A        return directionX;%0A    %7D%0A%0A    /**%0A     * Sets the X component of the velocity
 .%0A  
@@ -1353,16 +1353,24 @@
  public 
+void set
 Directio
@@ -1370,29 +1370,44 @@
 irection
- getD
+X(Optional%3CDouble%3E d
 irection
 () %7B%0A   
@@ -1398,17 +1398,17 @@
 irection
-(
+X
 ) %7B%0A    
@@ -1403,38 +1403,49 @@
 ionX) %7B%0A        
-return
+this.directionX =
  direction;%0A    
@@ -1430,32 +1430,33 @@
 ionX = direction
+X
 ;%0A    %7D%0A%0A    /**
@@ -1463,25 +1463,25 @@
 %0A     * 
-S
+G
 ets the 
 directio
@@ -1476,56 +1476,176 @@
 the 
-direction that the game's velocity will point at
+Y component of the velocity.%0A     */%0A    public Optional%3CDouble%3E getDirectionY() %7B%0A        return directionY;%0A    %7D%0A%0A    /**%0A     * Sets the Y component of the velocity
 .%0A  
@@ -1682,18 +1682,26 @@
 tion
-(Direction
+Y(Optional%3CDouble%3E
  dir
@@ -1706,16 +1706,17 @@
 irection
+Y
 ) %7B%0A    
@@ -1733,16 +1733,17 @@
 irection
+Y
  = direc
@@ -1746,16 +1746,17 @@
 irection
+Y
 ;%0A    %7D%0A
@@ -1784,29 +1784,17 @@
 the 
-acceleration constant
+magnitude
  of 

use x and y coordinates instead of absolute directions