path is on a lower ground if maze was resolved.
This commit is contained in:
@@ -1313,7 +1313,7 @@ public class Display extends JFrame
|
||||
try
|
||||
{
|
||||
FileOutputStream out = new FileOutputStream(outfile);
|
||||
Wall3d.streamWallsOut(params.getName(), (WallsProvider) model, out);
|
||||
Wall3d.streamWallsOut(params.getName(), model, out);
|
||||
out.flush();
|
||||
out.close();
|
||||
System.out.println("... Done.");
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.artisanlogiciel.games.stl;
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.artisanlogiciel.games.Brick;
|
||||
import org.artisanlogiciel.games.LabyModel;
|
||||
import org.artisanlogiciel.games.WallsProvider;
|
||||
|
||||
import java.io.OutputStream;
|
||||
@@ -28,7 +29,8 @@ public class Wall3d
|
||||
public final static Wall3d West = new Wall3d(1, 10, 10, 0, 0, 0);
|
||||
public final static Wall3d North = new Wall3d(10, 1, 10, 0, 10, 0);
|
||||
public final static Wall3d East = new Wall3d(1, 10, 10, 10, 0, 0);
|
||||
public final static Wall3d Ground = new Wall3d(10, 10, 2, 0, 0, 0);
|
||||
public final static Wall3d HighGround = new Wall3d(10, 10, 3, 0, 0, 0);
|
||||
public final static Wall3d LowGround = new Wall3d(10, 10, 2, 0, 0, 0);
|
||||
|
||||
int triangle[][][] = null;
|
||||
|
||||
@@ -157,7 +159,7 @@ public class Wall3d
|
||||
System.out.println(West.toString());
|
||||
}
|
||||
|
||||
public static void streamWallsOut(String name, WallsProvider provider, OutputStream stream) throws IOException
|
||||
public static void streamWallsOut(String name, LabyModel provider, OutputStream stream) throws IOException
|
||||
{
|
||||
int width = provider.getWidth();
|
||||
int height = provider.getHeight();
|
||||
@@ -200,7 +202,18 @@ public class Wall3d
|
||||
{
|
||||
stream.write(new Wall3d(East, x * xl, y * yl, 0).toString().getBytes());
|
||||
}
|
||||
stream.write(new Wall3d(Ground, x * xl, y * yl, 0).toString().getBytes());
|
||||
short path = provider.getPath(x,y);
|
||||
if ( ( path & LabyModel.SOLVED ) == LabyModel.SOLVED )
|
||||
// if ( (walls & ( Brick.GOAL | Brick.ENTRY ) ) == 0 )
|
||||
{
|
||||
// if ( ( (x+y) % 2) == 0 )
|
||||
|
||||
stream.write(new Wall3d(LowGround, x * xl, y * yl, 0).toString().getBytes());
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.write(new Wall3d(HighGround, x * xl, y * yl, 0).toString().getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user