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

package com.hypixel.hytale.procedurallib.logic;

public class ResultBuffer
{
    public static final Bounds2d bounds2d;
    public static final ResultBuffer2d buffer2d;
    public static final ResultBuffer3d buffer3d;
    
    static {
        bounds2d = new Bounds2d();
        buffer2d = new ResultBuffer2d();
        buffer3d = new ResultBuffer3d();
    }
    
    public static class ResultBuffer2d
    {
        public int hash;
        public int hash2;
        public int ix;
        public int iy;
        public int ix2;
        public int iy2;
        public double distance;
        public double distance2;
        public double x;
        public double y;
        public double x2;
        public double y2;
        
        public void register(final int hash, final int ix, final int iy, final double distance, final double x, final double y) {
            if (distance < this.distance) {
                this.ix = ix;
                this.iy = iy;
                this.distance = distance;
                this.x = x;
                this.y = y;
                this.hash = hash;
            }
        }
        
        public void register2(final int hash, final int ix, final int iy, final double distance, final double x, final double y) {
            if (distance < this.distance) {
                this.distance2 = this.distance;
                this.x2 = this.x;
                this.y2 = this.y;
                this.ix2 = this.ix;
                this.iy2 = this.iy;
                this.distance = distance;
                this.x = x;
                this.y = y;
                this.ix = ix;
                this.iy = iy;
                this.hash2 = this.hash;
                this.hash = hash;
            }
            else if (distance < this.distance2) {
                this.distance2 = distance;
                this.x2 = x;
                this.y2 = y;
                this.ix2 = ix;
                this.iy2 = iy;
                this.hash2 = hash;
            }
        }
    }
    
    public static class ResultBuffer3d
    {
        public int hash;
        public int hash2;
        public int ix;
        public int iy;
        public int iz;
        public int ix2;
        public int iy2;
        public int iz2;
        public double distance;
        public double distance2;
        public double x;
        public double y;
        public double z;
        public double x2;
        public double y2;
        public double z2;
        
        public void register(final int hash, final int ix, final int iy, final int iz, final double distance, final double x, final double y, final double z) {
            if (distance < this.distance) {
                this.hash = hash;
                this.ix = ix;
                this.iy = iy;
                this.iz = iz;
                this.distance = distance;
                this.x = x;
                this.y = y;
                this.z = z;
            }
        }
        
        public void register2(final int hash, final int ix, final int iy, final int iz, final double distance, final double x, final double y, final double z) {
            if (distance < this.distance) {
                this.distance2 = this.distance;
                this.x2 = this.x;
                this.y2 = this.y;
                this.z2 = this.z;
                this.ix2 = this.ix;
                this.iy2 = this.iy;
                this.iz2 = this.iz;
                this.distance = distance;
                this.x = x;
                this.y = y;
                this.z = z;
                this.ix = ix;
                this.iy = iy;
                this.iz = iz;
                this.hash2 = this.hash;
                this.hash = hash;
            }
            else if (distance < this.distance2) {
                this.distance2 = distance;
                this.x2 = x;
                this.y2 = y;
                this.z2 = z;
                this.ix2 = ix;
                this.iy2 = iy;
                this.iz2 = iz;
                this.hash2 = hash;
            }
        }
    }
    
    public static class Bounds2d
    {
        public double minX;
        public double minY;
        public double maxX;
        public double maxY;
        
        public void assign(final double minX, final double minY, final double maxX, final double maxY) {
            this.minX = minX;
            this.minY = minY;
            this.maxX = maxX;
            this.maxY = maxY;
        }
        
        public boolean contains(final double x, final double y) {
            return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
        }
    }
}
