X-Git-Url: http://deadsoftware.ru/gitweb?p=odcread.git;a=blobdiff_plain;f=alien.cc;h=fddd2024dbcb0dfd2ee200c52b3b93170f8c6a54;hp=49d19fe5c9b06829bdc8deac3a688890da957b78;hb=cf035fa1849a5e65c0d636ce2718bc2c85994680;hpb=51b3593cbfb33c1d7b4b588f3841c3c405e3a215 diff --git a/alien.cc b/alien.cc index 49d19fe..fddd202 100644 --- a/alien.cc +++ b/alien.cc @@ -8,15 +8,26 @@ std::string AlienPiece::toString() { return std::string("AlienPiece"); } -AlienPart::AlienPart(Store * const _store): store(_store) {} +std::string AlienPiece::toPlainText() { + return std::string(); +} + +AlienPart::AlienPart(Store * const store): d_store(store) {} std::string AlienPart::toString() { - if (store != 0) - return store->toString(); + if (d_store != 0) + return d_store->toString(); else return "NULL"; } +std::string AlienPart::toPlainText() { + if (d_store != 0) + return d_store->toPlainText(); + else + return std::string(); +} + Alien::Alien(INTEGER id, const TypePath &path): Store(id), d_path(path), d_comps() {} std::vector & Alien::getComponents() { @@ -31,4 +42,12 @@ std::string Alien::toString() { return sofar + "}"; } +std::string Alien::toPlainText() { + std::string sofar = std::string(); + for (int i = 0; i < d_comps.size(); ++i) { + sofar += d_comps[i]->toPlainText(); + } + return sofar; +} + }