Skip to content

Commit

Permalink
getters for Project
Browse files Browse the repository at this point in the history
  • Loading branch information
AyoubJebali committed Apr 19, 2024
1 parent 83bbe1d commit 2883479
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
26 changes: 11 additions & 15 deletions Projet.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <bits/stdc++.h>

#include "Resource.h"
// add function to allocate a resource or delete a resource;

class Projet
{
Expand All @@ -12,27 +12,23 @@ class Projet
float expenses=0,revenue=0;
std::string objectif;
std::string status;
std::vector<Resource*> Resources;

public:
Projet(const std::string &nom, const std::string &objectif, const std::string &status);

~Projet(){
for (auto *ressource : Resources)
{
delete ressource;
}
Resources.clear();
}

Projet(const Projet &other)
: nom(other.nom), objectif(other.objectif), status(other.status)
{

for (const auto &resource : other.Resources)
{
Resources.push_back(new Resource(*resource));
}
}

std::string getName(){
return nom;
}
std::string getObjectif(){
return objectif;
}
std::string getStatus(){
return status;
}
Projet& operator=(const Projet& other);
void addExpense(float a);
Expand Down
4 changes: 2 additions & 2 deletions Reservation.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "Reservation.h"

Reservation::Reservation(Date date, Projet* projet, Ressource* ressource):date(date), projet(projet), ressource(ressource){
Reservation::Reservation(Date date, Projet* projet, Resource* ressource):date(date), projet(projet), ressource(ressource){
this-> isEvent = false;
}
Reservation::Reservation(Date date, Event* evenement, Ressource* ressource):date(date), evenement(evenement), ressource(ressource){
Reservation::Reservation(Date date, Event* evenement, Resource* ressource):date(date), evenement(evenement), ressource(ressource){
this->isEvent=true;
}
bool Reservation::isThisEvent(){
Expand Down
8 changes: 4 additions & 4 deletions Reservation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
#include "Event.h"
#include "Date.h"

#include "Ressource.h"
#include "Resource.h"
class Reservation {
private:

Date date;
Projet* projet;
bool isEvent;
Event* evenement;
Ressource* ressource;
Resource* ressource;

public:
Reservation(Date date, Projet* projet, Ressource* ressource);
Reservation(Date date, Event* evenement, Ressource* ressource);
Reservation(Date date, Projet* projet, Resource* ressource);
Reservation(Date date, Event* evenement, Resource* ressource);
bool isThisEvent();
Date dateEvent();
};
Expand Down
1 change: 0 additions & 1 deletion Startup.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Startup : public User
Projets.push_back(p);
}


std::pair<double, double>& getCoordinates(){
return coordinates;
}
Expand Down

0 comments on commit 2883479

Please sign in to comment.