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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user