public boolean trainCanMove() {

		if (train.size() == 0)
			return true;
		else {
			int totalWeight = 0;
			for (int i = 0; i < train.size(); i++) {
				switch (train.get(i).getClass().getSimpleName()) {
				case LOCOMOTIVE:
					totalWeight += ((Locomotive) train.get(i)).getGrossWeight();
					break;
				case PASSENGERCAR:
					totalWeight += ((PassengerCar) train.get(i))
							.getGrossWeight();
					break;
				case FREIGHTCAR:
					totalWeight += ((FreightCar) train.get(i)).getGrossWeight();
					break;
				}
			}
			if (((Locomotive) train.get(0)).power() >= totalWeight)
				return true;
			else
				return false;

		}
	}