public boolean isDoneRendering() { for (AirplaneSprite plane : hangerPlanes) { if (plane.hasActions()) { return false; } } for (AirplaneSprite plane : runwayPlanes) { if (plane.hasActions()) { return false; } } return true; }
public void addPlaneFromBoard(AirplaneSprite plane) { if (hangerPlanes.size() == 4) { throw new IllegalStateException("Hanger Render Manager to full to add a plane to the runway"); } plane.moveToPoint(spawnPoints.get(hangerPlanes.size())); hangerPlanes.add(plane); }
public void movePlaneToRunway() { if (hangerPlanes.size() == 0) { throw new IllegalStateException("No planes in hanger to move"); } AirplaneSprite planeToMove = hangerPlanes.remove(); runwayPlanes.add(planeToMove); planeToMove.moveToPoint(spawnPoints.get(spawnPoints.size() - 1)); for (int i = 0; i < hangerPlanes.size(); ++i) { AirplaneSprite planeToShuffle = hangerPlanes.remove(); planeToShuffle.moveToPoint(spawnPoints.get(i)); hangerPlanes.add(planeToShuffle); } }
public void addPlane(AirplaneSprite plane) { if (hangerPlanes.size() == 4) { throw new IllegalStateException("Hanger Render Manager to full to add a plane to the runway"); } ImmutablePoint2 position = spawnPoints.get(hangerPlanes.size()); plane.moveToPoint(position); hangerPlanes.add(plane); }