From f76b6cb4abe3903967f8a91741541adbb2713f83 Mon Sep 17 00:00:00 2001 From: virgi Date: Fri, 31 May 2024 13:53:37 +0200 Subject: [PATCH] comment Teleporter --- OOP_D7_Project/src/backend/Teleporter.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OOP_D7_Project/src/backend/Teleporter.java b/OOP_D7_Project/src/backend/Teleporter.java index 7dcf792..30ad691 100644 --- a/OOP_D7_Project/src/backend/Teleporter.java +++ b/OOP_D7_Project/src/backend/Teleporter.java @@ -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;