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

@@ -1,9 +1,17 @@
package org.artisanlogiciel.games.maze;
public class BrickTextMapping
extends Brick {
import static org.artisanlogiciel.games.maze.Brick.*;
public static String getDirLine()
public class BrickTextMapping {
private String charmap;
public BrickTextMapping(String pCharMap)
{
charmap = pCharMap;
}
public static String getDefaultDirLine()
{
char dir[] = new char[16];
String s = "";
@@ -43,18 +51,22 @@ extends Brick {
}
public static char getChar(short walls)
public static char getDefaultChar(short walls)
{
// return getDirLine().charAt(walls & 0xFFF0);
return getDirLine().charAt(walls);
return getDefaultDirLine().charAt(walls);
}
public static char getChar(Brick brick)
public static char getDefaultChar(Brick brick)
{
// return getDirLine().charAt(walls & 0xFFF0);
return getChar(brick.walls);
return getDefaultChar(brick.walls);
}
public char getChar(Brick brick)
{
return charmap.charAt((brick.walls)*0xf);
}
}