Properly implement copying for universe and scenario

This allows a failed load to not clobber the currently-loaded save or scenario.
This commit is contained in:
2016-09-02 18:56:47 -04:00
parent e969da6fc1
commit 20f22d7952
16 changed files with 635 additions and 22 deletions

View File

@@ -115,6 +115,13 @@ public:
void reattach(cScenario& to);
virtual void writeTerrainTo(std::ostream& file) = 0;
virtual void readTerrainFrom(std::istream& file) = 0;
virtual cTown* clone() = 0;
// Copy-and-swap
// However, it's protected so that it can only be used by the clone implementations
protected:
virtual void swap(cTown& other);
cTown(const cTown& other);
cTown(cTown&& other);
};
std::ostream& operator<< (std::ostream& out, eLighting light);