mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Terminal Pieces
This commit is contained in:
parent
125f705a6a
commit
2afb468ae4
@ -60,4 +60,8 @@ public class IrisJigsawPiece extends IrisRegistrant
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
public boolean isTerminal() {
|
||||
return connectors.size() == 1;
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,11 @@ public class PlannedStructure {
|
||||
private KMap<String, IrisObject> objectRotationCache;
|
||||
private RNG rng;
|
||||
private boolean verbose;
|
||||
private boolean terminating;
|
||||
|
||||
public PlannedStructure(IrisJigsawStructure structure, IrisPosition position, RNG rng)
|
||||
{
|
||||
terminating = false;
|
||||
objectRotationCache = new KMap<>();
|
||||
verbose = true;
|
||||
this.pieces = new KList<>();
|
||||
@ -186,7 +188,14 @@ public class PlannedStructure {
|
||||
{
|
||||
for(String j : getData().getJigsawPoolLoader().load(i).getPieces().shuffleCopy(rng))
|
||||
{
|
||||
p.addIfMissing(getData().getJigsawPieceLoader().load(j));
|
||||
IrisJigsawPiece pi = getData().getJigsawPieceLoader().load(j);
|
||||
|
||||
if(terminating && !pi.isTerminal())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
p.addIfMissing(pi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,6 +207,11 @@ public class PlannedStructure {
|
||||
}
|
||||
|
||||
private void generateTerminators() {
|
||||
if(getStructure().isTerminate())
|
||||
{
|
||||
terminating = true;
|
||||
generateOutwards(structure.getMaxDepth());
|
||||
}
|
||||
}
|
||||
|
||||
public KList<PlannedPiece> getPiecesWithAvailableConnectors()
|
||||
|
Loading…
x
Reference in New Issue
Block a user