mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +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,
|
List<BoardElementContainer<Tile>> pointingNeighbours = listOfConveyorBeltsWithRobotPointingAtTile(true,
|
||||||
nextElementContainer, conveyorBeltsWithRobotsOn);
|
nextElementContainer, conveyorBeltsWithRobotsOn);
|
||||||
|
|
||||||
|
int conveyorBeltsWithRobotsPointingToSameTile = listOfConveyorBeltsWithRobotPointingAtTile(true,
|
||||||
|
nextElementContainer, conveyorBeltsWithRobotsOn).size();
|
||||||
listOfRow.add(currentConveyorBelt);
|
listOfRow.add(currentConveyorBelt);
|
||||||
|
|
||||||
if (blacklistedTiles.contains(nextElementContainer)) {
|
if (blacklistedTiles.contains(nextElementContainer)) {
|
||||||
blacklistedTiles.addAll(listOfRow);
|
blacklistedTiles.addAll(listOfRow);
|
||||||
listOfRow.clear();
|
listOfRow.clear();
|
||||||
|
} else if (conveyorBeltsWithRobotsPointingToSameTile > 0) {
|
||||||
|
blacklistedTiles.addAll(listOfRow);
|
||||||
|
listOfRow.clear();
|
||||||
} else if (currentConveyorBelt.getElement().getDirection() == Direction.getReverseDirection(nextDirection) &&
|
} else if (currentConveyorBelt.getElement().getDirection() == Direction.getReverseDirection(nextDirection) &&
|
||||||
conveyorBeltsWithRobotsOn.contains(nextElementContainer)) {
|
conveyorBeltsWithRobotsOn.contains(nextElementContainer)) {
|
||||||
blacklistedTiles.addAll(listOfRow);
|
blacklistedTiles.addAll(listOfRow);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user