All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.barrybecker4.simulation.cave.model.kernal.AbstractKernel Maven / Gradle / Ivy

There is a newer version: 1.6.2
Show newest version
package com.barrybecker4.simulation.cave.model.kernal;

import com.barrybecker4.simulation.cave.model.Cave;

/**
 * Looks only at immediate neighbors
 * @author Barry Becker
 */
public abstract class AbstractKernel implements Kernel {

    protected Cave cave;

    public AbstractKernel(Cave cave) {
         this.cave = cave;
    }

    protected boolean isOffEdge(int x, int y) {
        return (x < 0 || y < 0 || x >= cave.getWidth() || y >= cave.getLength());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy