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

package com.hypixel.hytale.builtin.hytalegenerator.framework.math;

import java.util.Arrays;
import javax.annotation.Nonnull;

public class SeedGenerator
{
    @Nonnull
    private final long[] coPrimes;
    private static final long FLOOR = 10000000L;
    
    public SeedGenerator(final long seed) {
        this.coPrimes = CoPrimeGenerator.generateCoPrimes(seed, 100, 7, 10000000L);
    }
    
    public long seedAt(final long x, final long y, final long z, final long w, final long k, final long t) {
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2] + w * this.coPrimes[3] + k * this.coPrimes[4] + t * this.coPrimes[5]) % this.coPrimes[6];
    }
    
    public long seedAt(final long x, final long y, final long z, final long w, final long k) {
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2] + w * this.coPrimes[3] + k * this.coPrimes[4]) % this.coPrimes[6];
    }
    
    public long seedAt(final long x, final long y, final long z, final long w) {
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2] + w * this.coPrimes[3]) % this.coPrimes[6];
    }
    
    public long seedAt(final long x, final long y, final long z) {
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2]) % this.coPrimes[6];
    }
    
    public long seedAt(final long x, final long y) {
        return (x * this.coPrimes[0] + y * this.coPrimes[1]) % this.coPrimes[6];
    }
    
    public long seedAt(final double xd, final double yd, final double zd, final double wd, final double kd, final double td, final double resolution) {
        final int x = (int)(xd * resolution);
        final int y = (int)(yd * resolution);
        final int z = (int)(zd * resolution);
        final int w = (int)(wd * resolution);
        final int k = (int)(kd * resolution);
        final int t = (int)(td * resolution);
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2] + w * this.coPrimes[3] + k * this.coPrimes[4] + t * this.coPrimes[5]) % this.coPrimes[6];
    }
    
    public long seedAt(final double xd, final double yd, final double zd, final double wd, final double kd, final double resolution) {
        final int x = (int)(xd * resolution);
        final int y = (int)(yd * resolution);
        final int z = (int)(zd * resolution);
        final int w = (int)(wd * resolution);
        final int k = (int)(kd * resolution);
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2] + w * this.coPrimes[3] + k * this.coPrimes[4]) % this.coPrimes[6];
    }
    
    public long seedAt(final double xd, final double yd, final double zd, final double wd, final double resolution) {
        final int x = (int)(xd * resolution);
        final int y = (int)(yd * resolution);
        final int z = (int)(zd * resolution);
        final int w = (int)(wd * resolution);
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2] + w * this.coPrimes[3]) % this.coPrimes[6];
    }
    
    public long seedAt(final double xd, final double yd, final double zd, final double resolution) {
        final int x = (int)(xd * resolution);
        final int y = (int)(yd * resolution);
        final int z = (int)(zd * resolution);
        return (x * this.coPrimes[0] + y * this.coPrimes[1] + z * this.coPrimes[2]) % this.coPrimes[6];
    }
    
    public long seedAt(final double xd, final double yd, final double resolution) {
        final int x = (int)(xd * resolution);
        final int y = (int)(yd * resolution);
        return (x * this.coPrimes[0] + y * this.coPrimes[1]) % this.coPrimes[6];
    }
    
    @Nonnull
    @Override
    public String toString() {
        return "SeedGenerator{coPrimes=" + Arrays.toString(this.coPrimes);
    }
}
