-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Expand file tree
/
Copy pathParkingLot.hpp
More file actions
34 lines (26 loc) · 806 Bytes
/
ParkingLot.hpp
File metadata and controls
34 lines (26 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef PARKING_LOT_HPP
#define PARKING_LOT_HPP
#include <vector>
#include <map>
#include <string>
#include "ParkingSpot.hpp"
class ParkingLot {
private:
std::vector<ParkingSpot*> spots;
std::map<std::string, ParkingSpot*> occupiedSpots; // licensePlate -> spot
int capacity;
int availableSpots;
public:
ParkingLot(int numCompact, int numRegular, int numLarge);
~ParkingLot();
int getCapacity() const;
int getAvailableSpots() const;
bool parkVehicle(Vehicle* vehicle);
Vehicle* removeVehicle(const std::string& licensePlate);
ParkingSpot* findVehicle(const std::string& licensePlate) const;
void displayInfo() const;
void displayOccupancy() const;
private:
ParkingSpot* findAvailableSpot(const Vehicle* vehicle) const;
};
#endif