Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- typedef string Forme;
- typedef string Couleur;
- class Brique{
- private:
- Forme forme;
- Couleur couleur;
- public:
- Brique(const& string f, const& string c)
- :forme(f), couleur(c)
- {}
- string getCouleur() const
- {
- return couleur;
- }
- void afficher(ostream& sortie)
- {
- if(couleur.size() > 0){
- sortie << "(" << forme << ", " << couleur << ")";
- } else {
- sortie << forme;
- }
- }
- };
- ostream& operator<<(ostream& sortie, const& Brique b)
- {
- b.afficher(sortie);
- return sortie;
- }
- class Construction
- {
- friend class Grader;
- public:
- vector<vector<vector<Brique>>> contenu;
- Construction(const& Brique b)
- :contenu({{{b}}})
- {}
- Construction(const& Construction c)
- :contenu(c.getContenu())
- {}
- vector<vector<vector<Brique>>> getContenu() const
- {
- return contenu;
- }
- void afficher(ostream& sortie)
- {
- for(size_t i(contenu.size()-1); i > 0; i--){
- sortie << "couche " << i << " :\n";
- for(size_t j(contenu[i].size()-1); j > 0; j--){
- for(size_t k(contenu[i][j].size()-1); k > 0; k--){
- contenu[i][j][k].afficher(sortie);
- }
- }
- sortie << "\n";
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement