comment Teleporter

This commit is contained in:
virgi 2024-05-31 13:53:37 +02:00
parent 4ef99af2a1
commit f76b6cb4ab
1 changed files with 6 additions and 3 deletions

View File

@ -1,14 +1,17 @@
package backend;
//This class is here to deal with the border. We have two state, closed and loop.
//When we select loop the cell will take into account the state of the cell at the opposite of the grid.
public class Teleporter {
private int size = 0;
public Teleporter(int size) {
this.size = size;
}
public int position(int value, boolean loop) {
int out = 0;
if (loop) {
if (value>=0) {
int out = 0;
if (loop) { // verify if we have clicked on the loop option
if (value>=0) {
out = value;
if (out>=size) {
out = out - size;