prepare for hexagon display & other models

- display cell as hexagon is Display.mHexagon if set ( not default )
will need a checkbox to set this
- various new models preparation...
This commit is contained in:
philippe lhardy
2020-12-27 15:40:22 +01:00
parent e146199ba0
commit afbe26065b
15 changed files with 403 additions and 26 deletions

View File

@@ -16,11 +16,13 @@ import org.artisanlogiciel.games.maze.WallsProvider;
* bit value :
* - set : there is a wall , no move in that direction
* - unset : move is possible , there is no wall
*
*/
public class HalfSquareRasterModel
implements WallsProvider,
MovesProvider,
WidthHeightProvider
WidthHeightProvider,
HalfSquareProvider
{
int LEFT = 0x01;
int DOWN = 0x02;
@@ -42,7 +44,16 @@ public class HalfSquareRasterModel
this.width = width;
this.height = height;
lines = new long[height][(BITSX * width)/USED_BITS];
lines = new long[height][getLongs()];
}
public int getLongs()
{
return (BITSX * width)/USED_BITS;
}
public long[][] getLines() {
return lines;
}
public void setLeftDown(int x, int y, short moves)