com.barrybecker4.simulation.cave.model.kernal.AbstractKernel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bb4-cave Show documentation
Show all versions of bb4-cave Show documentation
bb4-simulations java code.
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