// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.math;

import javax.annotation.Nonnull;
import io.netty.buffer.ByteBuf;

public class Vec4f
{
    public static final int SIZE = 16;
    public final float x;
    public final float y;
    public final float z;
    public final float w;
    
    public Vec4f(final float x, final float y, final float z, final float w) {
        this.x = x;
        this.y = y;
        this.z = z;
        this.w = w;
    }
    
    @Nonnull
    public static Vec4f deserialize(@Nonnull final ByteBuf buf, final int offset) {
        return new Vec4f(Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + 4)), Float.intBitsToFloat(buf.getIntLE(offset + 8)), Float.intBitsToFloat(buf.getIntLE(offset + 12)));
    }
    
    public void serialize(@Nonnull final ByteBuf buf) {
        buf.writeIntLE(Float.floatToRawIntBits(this.x));
        buf.writeIntLE(Float.floatToRawIntBits(this.y));
        buf.writeIntLE(Float.floatToRawIntBits(this.z));
        buf.writeIntLE(Float.floatToRawIntBits(this.w));
    }
}
