From b1c59453c1b1f4ec61607d356cd79a756ee465dd Mon Sep 17 00:00:00 2001 From: Christos Choutouridis Date: Sat, 24 Oct 2020 22:37:41 +0300 Subject: [PATCH] DEV: Comment rework --- src/net/hoo2/auth/labyrinth/Board.java | 19 ++++++++++--------- src/net/hoo2/auth/labyrinth/Game.java | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/net/hoo2/auth/labyrinth/Board.java b/src/net/hoo2/auth/labyrinth/Board.java index 9db272c..21f5874 100644 --- a/src/net/hoo2/auth/labyrinth/Board.java +++ b/src/net/hoo2/auth/labyrinth/Board.java @@ -270,14 +270,15 @@ class Board { * Predicate to check if a wall creates a closed room. * * This algorithm has a complexity of O(N^2) where N represents the total - * number of tiles it should be used with care. + * number of tiles. + * It should be used with care. * * @param tileId The tileId of the wall where the wall is. * @param direction The wall's relative direction from the tile. * @return True if the wall creates a closed room, false otherwise. */ - private boolean createsClosedRoom (int tileId, int direction) { - // Get a snapshot of the current walls + private boolean makesClosedRoom (int tileId, int direction) { + // Get a snapshot list of all the walls (all the walls on the board) ArrayList w = new ArrayList(); for (Edge it : walls) w.add(new Edge(it)); @@ -286,13 +287,13 @@ class Board { Graph g = new Graph(new Edge(tileId, direction)); int size; do { - size = w.size(); + size = w.size(); // mark the size (before the pass) for (int i =0, S=w.size() ; i= Const.maxTileWalls) return false; break; } - if (Session.loopGuard && createsClosedRoom(tileId, direction)) + if (Session.loopGuard && makesClosedRoom(tileId, direction)) return false; return true; } diff --git a/src/net/hoo2/auth/labyrinth/Game.java b/src/net/hoo2/auth/labyrinth/Game.java index f273bd6..dcef8b2 100644 --- a/src/net/hoo2/auth/labyrinth/Game.java +++ b/src/net/hoo2/auth/labyrinth/Game.java @@ -83,7 +83,7 @@ public class Game { case "--norooms": Session.loopGuard = true; break; - + case "-i": case "--interactive": Session.interactive = true;