Skip to content

Instantly share code, notes, and snippets.

@thegabriele97
Created October 22, 2018 08:07
Show Gist options
  • Save thegabriele97/57bb2e2ad05394684b82f97983f04efe to your computer and use it in GitHub Desktop.
Save thegabriele97/57bb2e2ad05394684b82f97983f04efe to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include "AM/Showcase.hpp"
#include "AM/Person.hpp"
int main() {
//CREATE PERSON OBJ
Person gabriele("gabriele", "la greca");
Person carlotta("carlotta", "la greca");
//CREATE SHOWCASE OBJ
Showcase sc1("test showcase 1");
//TESTING ADDING PEOPLE <-> SHOWCASE
sc1.addPerson(gabriele);
carlotta.addShowcase(sc1);
sc1.addPerson(carlotta);
//CREATING ACTIVITYLIST
ActivityList* ac1 = sc1.createActivityList("activity list 1");
ActivityList* ac2 = sc1.createActivityList("activity list 2");
//TESTING ACTIVITY
Activity* a1 = ac1->createActivity("To do 1 - boring");
Activity* a2 = ac1->createActivity("To do 2 - happier");
//TESTING ADDING PEOPLE <-> ACTIVITY
a1->addPerson(gabriele);
gabriele.addActivity(a1);
gabriele.addActivity(a2);
a2->addPerson(carlotta);
//testing sub activity
a1->getSubActivityList()->createSubActivity("clean bathroom");
a1->getSubActivityList()->createSubActivity("clean cucina");
a2->getSubActivityList()->createSubActivity("clean bedroom");
a2->getSubActivityList()->createSubActivity("do a walk with your dog");
Activity* a3 = ac2->createActivity("Programming..");
a3->getSubActivityList()->createSubActivity("Finish this fucking program!");
int i = 0;
for (auto a : gabriele.getShowcaseContainer()) {
std::cout << i++ << ") Showcase: " + a->getName() << std::endl;
for (auto b : a->getActivityListContainer()) {
std::cout << i++ << ") ActivityList: " + b->getName() << std::endl;
for (auto c : b->getActivityContainer()) {
std::cout << i++ << ") Activity: " + c->getTitle() << std::endl;
for (auto d : c->getSubActivityList()->getSubActivityContainer()) {
std::cout << i++ << ") Activity: " + d->getTitle() + " inside " + c->getTitle() << std::endl;
}
}
}
}
sc1.removeActivityList(ac1);
std::cout << sc1.removePerson(carlotta) << std::endl;
std::cout << gabriele.removeShowcase(sc1) << std::endl;
std::cout << sc1.removePerson(gabriele) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment