mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 15:19:35 +01:00
Legger til sjekk for robotkollisjon ved transportbånd bevegelse
This commit is contained in:
parent
da17c923df
commit
4a47517ca6
@ -365,11 +365,16 @@ public class RoboRallyGame implements IDrawableGame {
|
||||
List<BoardElementContainer<Tile>> pointingNeighbours = listOfConveyorBeltsWithRobotPointingAtTile(true,
|
||||
nextElementContainer, conveyorBeltsWithRobotsOn);
|
||||
|
||||
int conveyorBeltsWithRobotsPointingToSameTile = listOfConveyorBeltsWithRobotPointingAtTile(true,
|
||||
nextElementContainer, conveyorBeltsWithRobotsOn).size();
|
||||
listOfRow.add(currentConveyorBelt);
|
||||
|
||||
if (blacklistedTiles.contains(nextElementContainer)) {
|
||||
blacklistedTiles.addAll(listOfRow);
|
||||
listOfRow.clear();
|
||||
} else if (conveyorBeltsWithRobotsPointingToSameTile > 0) {
|
||||
blacklistedTiles.addAll(listOfRow);
|
||||
listOfRow.clear();
|
||||
} else if (currentConveyorBelt.getElement().getDirection() == Direction.getReverseDirection(nextDirection) &&
|
||||
conveyorBeltsWithRobotsOn.contains(nextElementContainer)) {
|
||||
blacklistedTiles.addAll(listOfRow);
|
||||
|
Loading…
x
Reference in New Issue
Block a user