jackson databind import

- and some reowrk to use Position more than (x,y) parameters
This commit is contained in:
philippe lhardy
2021-11-03 08:30:30 +01:00
parent 02fda1fc2e
commit 619e9b9f19
9 changed files with 126 additions and 75 deletions

View File

@@ -2,8 +2,6 @@ package org.artisanlogiciel.games.maze;
public class XYGridIterator {
final static Position stepX = new Position(1,0);
final static Position stepY = new Position( 0,1);
Position min;
Position max;
@@ -31,10 +29,10 @@ public class XYGridIterator {
if ( next != null)
{
Position current = new Position(next);
next.doTranslate(stepX);
next.doTranslate(Position.stepX);
if ( next.getX() >= max.getX()) {
if (next.getY() < max.getY() - 1) {
next.setX(min.getX()).doTranslate(stepY);
next.setX(min.getX()).doTranslate(Position.stepY);
} else {
next = null;
}