Created
October 22, 2018 08:07
-
-
Save thegabriele97/57bb2e2ad05394684b82f97983f04efe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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