1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

- Compile fix - Renamed map operations

This commit is contained in:
beegee1 2013-04-22 15:08:04 +00:00
parent dd78205ce8
commit 8d82c49a99
3 changed files with 25 additions and 25 deletions

View File

@ -184,12 +184,12 @@ void CMapEditManager::clearTerrain(CRandomGenerator * gen)
void CMapEditManager::drawTerrain(const MapRect & rect, ETerrainType terType, CRandomGenerator * gen)
{
execute(make_unique<DrawTerrainOperation>(map, rect, terType, gen));
execute(make_unique<CDrawTerrainOperation>(map, rect, terType, gen));
}
void CMapEditManager::insertObject(const int3 & pos, CGObjectInstance * obj)
{
execute(make_unique<InsertObjectOperation>(map, pos, obj));
execute(make_unique<CInsertObjectOperation>(map, pos, obj));
}
void CMapEditManager::execute(unique_ptr<CMapOperation> && operation)
@ -348,13 +348,13 @@ const TerrainViewPattern & CTerrainViewPatternConfig::getPatternById(ETerrainGro
throw std::runtime_error("Pattern with ID not found: " + id);
}
DrawTerrainOperation::DrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen)
CDrawTerrainOperation::CDrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen)
: CMapOperation(map), rect(rect), terType(terType), gen(gen)
{
}
void DrawTerrainOperation::execute()
void CDrawTerrainOperation::execute()
{
for(int i = rect.x; i < rect.x + rect.width; ++i)
{
@ -371,22 +371,22 @@ void DrawTerrainOperation::execute()
updateTerrainViews(viewRect & MapRect(int3(0, 0, viewRect.z), map->width, map->height)); // Rect should not overlap map dimensions
}
void DrawTerrainOperation::undo()
void CDrawTerrainOperation::undo()
{
//TODO
}
void DrawTerrainOperation::redo()
void CDrawTerrainOperation::redo()
{
//TODO
}
std::string DrawTerrainOperation::getLabel() const
std::string CDrawTerrainOperation::getLabel() const
{
return "Draw Terrain";
}
void DrawTerrainOperation::updateTerrainViews(const MapRect & rect)
void CDrawTerrainOperation::updateTerrainViews(const MapRect & rect)
{
for(int i = rect.x; i < rect.x + rect.width; ++i)
{
@ -454,7 +454,7 @@ void DrawTerrainOperation::updateTerrainViews(const MapRect & rect)
}
}
ETerrainGroup::ETerrainGroup DrawTerrainOperation::getTerrainGroup(ETerrainType terType) const
ETerrainGroup::ETerrainGroup CDrawTerrainOperation::getTerrainGroup(ETerrainType terType) const
{
switch(terType)
{
@ -471,7 +471,7 @@ ETerrainGroup::ETerrainGroup DrawTerrainOperation::getTerrainGroup(ETerrainType
}
}
DrawTerrainOperation::ValidationResult DrawTerrainOperation::validateTerrainView(const int3 & pos, const TerrainViewPattern & pattern, int recDepth /*= 0*/) const
CDrawTerrainOperation::ValidationResult CDrawTerrainOperation::validateTerrainView(const int3 & pos, const TerrainViewPattern & pattern, int recDepth /*= 0*/) const
{
ETerrainType centerTerType = map->getTile(pos).terType;
int totalPoints = 0;
@ -601,7 +601,7 @@ DrawTerrainOperation::ValidationResult DrawTerrainOperation::validateTerrainView
return ValidationResult(true, transitionReplacement);
}
bool DrawTerrainOperation::isSandType(ETerrainType terType) const
bool CDrawTerrainOperation::isSandType(ETerrainType terType) const
{
switch(terType)
{
@ -614,7 +614,7 @@ bool DrawTerrainOperation::isSandType(ETerrainType terType) const
}
}
TerrainViewPattern DrawTerrainOperation::getFlippedPattern(const TerrainViewPattern & pattern, int flip) const
TerrainViewPattern CDrawTerrainOperation::getFlippedPattern(const TerrainViewPattern & pattern, int flip) const
{
if(flip == 0)
{
@ -641,19 +641,19 @@ TerrainViewPattern DrawTerrainOperation::getFlippedPattern(const TerrainViewPatt
return ret;
}
DrawTerrainOperation::ValidationResult::ValidationResult(bool result, const std::string & transitionReplacement /*= ""*/)
CDrawTerrainOperation::ValidationResult::ValidationResult(bool result, const std::string & transitionReplacement /*= ""*/)
: result(result), transitionReplacement(transitionReplacement)
{
}
InsertObjectOperation::InsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj)
CInsertObjectOperation::CInsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj)
: CMapOperation(map), pos(pos), obj(obj)
{
}
void InsertObjectOperation::execute()
void CInsertObjectOperation::execute()
{
obj->pos = pos;
obj->id = ObjectInstanceID(map->objects.size());
@ -669,17 +669,17 @@ void InsertObjectOperation::execute()
map->addBlockVisTiles(obj);
}
void InsertObjectOperation::undo()
void CInsertObjectOperation::undo()
{
//TODO
}
void InsertObjectOperation::redo()
void CInsertObjectOperation::redo()
{
execute();
}
std::string InsertObjectOperation::getLabel() const
std::string CInsertObjectOperation::getLabel() const
{
return "Insert Object";
}

View File

@ -217,11 +217,11 @@ private:
static boost::mutex smx;
};
/// The DrawTerrainOperation class draws a terrain area on the map.
class DrawTerrainOperation : public CMapOperation
/// The CDrawTerrainOperation class draws a terrain area on the map.
class CDrawTerrainOperation : public CMapOperation
{
public:
DrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen);
CDrawTerrainOperation(CMap * map, const MapRect & rect, ETerrainType terType, CRandomGenerator * gen);
void execute() override;
void undo() override;
@ -255,11 +255,11 @@ private:
CRandomGenerator * gen;
};
/// The InsertObjectOperation class inserts an object to the map.
class InsertObjectOperation : public CMapOperation
/// The CInsertObjectOperation class inserts an object to the map.
class CInsertObjectOperation : public CMapOperation
{
public:
InsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj);
CInsertObjectOperation(CMap * map, const int3 & pos, CGObjectInstance * obj);
void execute() override;
void undo() override;

View File

@ -515,7 +515,7 @@ int main(int argc, char** argv)
logConfig.configureDefault();
if(argc > 1)
{
port = std::stoi(argv[1]);
port = boost::lexical_cast<int>(argv[1]);
}
preinitDLL(console);