X-Git-Url: https://git.llucax.com/z.facultad/75.29/susanita.git/blobdiff_plain/a86e26ae42584c979262de7f6ddefa815ac7c625..74c50ae54daacf5a14ffe941806f554b50b6f7a8:/src/susanita.cpp?ds=inline diff --git a/src/susanita.cpp b/src/susanita.cpp index 12cba02..17a601e 100644 --- a/src/susanita.cpp +++ b/src/susanita.cpp @@ -1,5 +1,6 @@ #include "susanita.h" #include +#include Susanita::~Susanita() { @@ -37,3 +38,44 @@ get_persona(const std::string& nombre) const return ip->second; } +void +Susanita:: +mostrar_estado(int mostrar_prios) const +{ + std::cout << "Personas\n"; + for (personas_type::const_iterator ih = hombres.begin(); + ih != hombres.end(); ++ih) + std::cout << **ih << "\n"; + std::cout << "\n"; + for (personas_type::const_iterator im = mujeres.begin(); + im != mujeres.end(); ++im) + std::cout << **im << "\n"; + std::cout << "\n" << std::endl; + + if (mostrar_prios) + return; + + std::cout << "Prioridades\n"; + for (personas_type::const_iterator ih = hombres.begin(); + ih != hombres.end(); ++ih) { + Persona& h = **ih; + std::cout << h << "\n"; + for (personas_type::iterator im = h.prefs.begin(); + im != h.prefs.end(); ++im) { + Persona &p = **im; + std::cout << "\t" << p << "\n"; + } + } + std::cout << "\n"; + for (personas_type::const_iterator ih = mujeres.begin(); + ih != mujeres.end(); ++ih) { + Persona& h = **ih; + std::cout << h << "\n"; + for (personas_type::iterator im = h.prefs.begin(); + im != h.prefs.end(); ++im) { + Persona &p = **im; + std::cout << "\t" << p << "\n"; + } + } +} +