package rlbot.gamestate;

import com.google.flatbuffers.FlatBufferBuilder;
import rlbot.flat.Vector3Partial;

/**
 * See https://github.com/RLBot/RLBotJavaExample/wiki/Manipulating-Game-State
 */
public class DesiredVector3 {
    private Float x;
    private Float y;
    private Float z;

    public DesiredVector3() {
    }

    public DesiredVector3(Float x, Float y, Float z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public Float getX() {
        return x;
    }

    public DesiredVector3 withX(Float x) {
        this.x = x;
        return this;
    }

    public Float getY() {
        return y;
    }

    public DesiredVector3 withY(Float y) {
        this.y = y;
        return this;
    }

    public Float getZ() {
        return z;
    }

    public DesiredVector3 withZ(Float z) {
        this.z = z;
        return this;
    }

    /**
     * You may wish to override this in order to invert the x value, which would give you a normal
     * right-handed coordinate system.
     */
    public int toFlatbuffer(FlatBufferBuilder builder) {
        Vector3Partial.startVector3Partial(builder);
        if (x != null) {
            Vector3Partial.addX(builder, rlbot.flat.Float.createFloat(builder, x));
        }
        if (y != null) {
            Vector3Partial.addY(builder, rlbot.flat.Float.createFloat(builder, y));
        }
        if (z != null) {
            Vector3Partial.addZ(builder, rlbot.flat.Float.createFloat(builder, z));
        }
        return Vector3Partial.endVector3Partial(builder);
    }
}

@@ -487,24 +487,151 @@
 urn x;%0A    %7D
+%0A    %0A    /**%0A     * @returns %7B@code true%7D If x is not null.%0A     */%0A    public boolean hasX() %7B%0A        return x != null%0A    %7D
 %0A%0A    public
@@ -756,24 +756,151 @@
 urn y;%0A    %7D
+%0A    %0A    /**%0A     * @returns %7B@code true%7D If y is not null.%0A     */%0A    public boolean hasY() %7B%0A        return y != null%0A    %7D
 %0A%0A    public
@@ -1021,32 +1021,159 @@
  return z;%0A    %7D
+%0A    %0A    /**%0A     * @returns %7B@code true%7D If z is not null.%0A     */%0A    public boolean hasZ() %7B%0A        return z != null%0A    %7D
 %0A%0A    public Des
@@ -1525,25 +1525,22 @@
     if (
-x != null
+hasX()
 ) %7B%0A    
@@ -1614,17 +1614,22 @@
 uilder, 
-x
+getX()
 ));%0A    
@@ -1646,25 +1646,22 @@
     if (
-y != null
+hasY()
 ) %7B%0A    
@@ -1735,17 +1735,22 @@
 uilder, 
-y
+getY()
 ));%0A    
@@ -1767,25 +1767,22 @@
     if (
-z != null
+hasZ()
 ) %7B%0A    
@@ -1856,17 +1856,22 @@
 uilder, 
-z
+getZ()
 ));%0A    

Update DesiredVector3.java (#447)