-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Expand file tree
/
Copy pathParkingLot.hpp
More file actions
39 lines (32 loc) · 1.05 KB
/
ParkingLot.hpp
File metadata and controls
39 lines (32 loc) · 1.05 KB
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
35
36
37
38
39
#ifndef PARKING_LOT_HPP
#define PARKING_LOT_HPP
#include <vector>
#include <map>
#include <string>
#include "ParkingSpot.hpp"
#include "ParkingTicket.hpp"
#include "FeeFlatRate.hpp"
#include "FeeVehicleBased.hpp"
class ParkingLot {
private:
std::vector<ParkingSpot*> spots;
std::map<std::string, ParkingSpot*> occupiedSpots; // licensePlate -> spot
std::map<ParkingSpot*, ParkingTicket*> activeTickets; // ParkingSpot* -> ticket
int capacity;
int availableSpots;
FeeStrategy* feeStrategy;
public:
ParkingLot(int numCompact, int numRegular, int numLarge, FeeStrategy* feeStrategy);
~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;
void displayFee(ParkingTicket* ticket);
private:
ParkingSpot* findAvailableSpot(const Vehicle* vehicle) const;
};
#endif