| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "ieclass.h" |
| 4 |
|
| 5 |
namespace |
| 6 |
{ |
| 7 |
const std::string MATERIAL_PREFIX("MATERIAL: "); |
| 8 |
const std::string ENTITYDEF_PREFIX("ENTITYDEF: "); |
| 9 |
} |
| 10 |
|
| 11 |
class DeprecatedEclassCollector : |
| 12 |
public EntityClassVisitor |
| 13 |
{ |
| 14 |
private: |
| 15 |
std::string _fixupCode; |
| 16 |
|
| 17 |
public: |
| 18 |
void visit(const IEntityClassPtr& eclass) |
| 19 |
{ |
| 20 |
const std::string attr = eclass->getAttributeValue("editor_replacement"); |
| 21 |
if (attr.empty()) |
| 22 |
return; |
| 23 |
|
| 24 |
// Non-empty editor_replacement, add fixup code |
| 25 |
_fixupCode += ENTITYDEF_PREFIX + eclass->getDeclName() + " => " + attr + "\n"; |
| 26 |
} |
| 27 |
|
| 28 |
const std::string& getFixupCode() const |
| 29 |
{ |
| 30 |
return _fixupCode; |
| 31 |
} |
| 32 |
}; |