Files
artloglaby/java/org/artisanlogiciel/games/maze/Brick.java
philippe lhardy e146199ba0 Split Display (gui) and Maze (work), prepare for another model
- prepare for a shorter storage model without any resolution
2020-12-20 19:18:17 +01:00

64 lines
1.0 KiB
Java

package org.artisanlogiciel.games.maze;
/*
2x2 Tile to represent a labyrinth position with some walls
this is 2x2 downright most part of 3x3 centered tile.
center right
down downright
ab
cd
a is 'H' or '.' or ' '
bcd is within 'H' or ' '
*/
public class Brick
{
public final static short LEFT = 1;
public final static short DOWN = 2;
public final static short RIGHT = 4;
public final static short UP = 8;
public final static short ENTRY = 16;
public final static short GOAL = 32;
char a;
char b;
char c;
char d;
short walls; // according to LabyModel.getWalls();
protected Brick()
{
//
}
public Brick(String up, String low, short walls)
{
a = up.charAt(0);
b = up.charAt(1);
c = low.charAt(0);
d = low.charAt(1);
this.walls = walls;
}
public String getUpString()
{
return "" + a + b;
}
public String getLowString()
{
return "" + c + d;
}
public short getWalls()
{
return walls;
}
}