mirror of
https://github.com/vcmi/vcmi.git
synced 2026-05-22 09:55:17 +02:00
Remove more redundant virtual specifiers
`grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../redundant_virtual.txt`
```python
import os
with open("../redundant_virtual.txt") as f:
for line in f:
print()
line: str = line.strip()
print(line)
tmp = line.split(":",2)
file = tmp[0].strip()
code = tmp[-1].strip()
print(file)
print(code)
new_code = code.replace("virtual ", "", 1)
# https://superuser.com/a/802490/578501
command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
os.system(command)
```
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Goals
|
||||
BuildThis(BuildingID Bid, const CGTownInstance * tid);
|
||||
|
||||
bool operator==(const BuildThis & other) const override;
|
||||
virtual std::string toString() const override;
|
||||
std::string toString() const override;
|
||||
void accept(AIGateway * ai) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Goals
|
||||
|
||||
bool operator==(const BuyArmy & other) const override;
|
||||
|
||||
virtual std::string toString() const override;
|
||||
std::string toString() const override;
|
||||
|
||||
void accept(AIGateway * ai) override;
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Goals
|
||||
|
||||
bool isElementar() const override { return true; }
|
||||
|
||||
virtual HeroPtr getHero() const override { return AbstractGoal::hero; }
|
||||
HeroPtr getHero() const override { return AbstractGoal::hero; }
|
||||
|
||||
int getHeroExchangeCount() const override { return 0; }
|
||||
};
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace Goals
|
||||
}
|
||||
|
||||
bool operator==(const CaptureObject & other) const override;
|
||||
virtual Goals::TGoalVec decompose() const override;
|
||||
virtual std::string toString() const override;
|
||||
Goals::TGoalVec decompose() const override;
|
||||
std::string toString() const override;
|
||||
bool hasHash() const override { return true; }
|
||||
uint64_t getHash() const override;
|
||||
};
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace Goals
|
||||
{
|
||||
}
|
||||
|
||||
virtual Goals::TGoalVec decompose() const override;
|
||||
virtual std::string toString() const override;
|
||||
Goals::TGoalVec decompose() const override;
|
||||
std::string toString() const override;
|
||||
bool hasHash() const override { return true; }
|
||||
uint64_t getHash() const override;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Goals
|
||||
}
|
||||
|
||||
bool operator==(const Composition & other) const override;
|
||||
virtual std::string toString() const override;
|
||||
std::string toString() const override;
|
||||
void accept(AIGateway * ai) override;
|
||||
Composition & addNext(const AbstractGoal & goal);
|
||||
Composition & addNext(TSubgoal goal);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Goals
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual std::string toString() const override
|
||||
std::string toString() const override
|
||||
{
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Goals
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual std::string toString() const override;
|
||||
std::string toString() const override;
|
||||
void accept(AIGateway * ai) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Goals
|
||||
StayAtTown(const CGTownInstance * town, AIPath & path);
|
||||
|
||||
bool operator==(const StayAtTown & other) const override;
|
||||
virtual std::string toString() const override;
|
||||
std::string toString() const override;
|
||||
void accept(AIGateway * ai) override;
|
||||
float getMovementWasted() const { return movementWasted; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user