refactor: remove some useles code

This commit is contained in:
pavanvo 2022-08-28 19:21:44 +04:00
parent 78a3eb1abb
commit a0c8383be0
No known key found for this signature in database
GPG Key ID: 34C1C36681B4AD84
2 changed files with 3 additions and 10 deletions

View File

@ -1272,7 +1272,9 @@ void UnitType::sortCommandTypes(CommandTypes cts){
//Cores
for(auto &&cc : CommandHelper::getCoresCC()){
CommandTypeFilter(cts, ctCores, cc);
std::copy_if(cts.begin(), cts.end(), std::back_inserter(ctCores), [cc](CommandType* i) {
return i->getClass() == cc;
});
}
int nullCount = 4 - ctCores.size();
for(int i=0; i<nullCount; i++){
@ -1301,14 +1303,6 @@ void UnitType::sortCommandTypes(CommandTypes cts){
}
}
void UnitType::CommandTypeFilter(CommandTypes &input, CommandTypes &output, CommandClass cc){
std::copy_if(input.begin(), input.end(), std::back_inserter(output), [cc](CommandType* i) {
if(i->getClass() == cc)
return true;
else return false;
});
}
const CommandType* UnitType::findCommandTypeById(int id) const{
const HarvestEmergencyReturnCommandType *result = dynamic_cast<const HarvestEmergencyReturnCommandType *>(ctHarvestEmergencyReturnCommandType.get());
if(result != NULL && id == result->getId()) {

View File

@ -365,7 +365,6 @@ private:
void computeFirstStOfClass();
void computeFirstCtOfClass();
void sortCommandTypes(CommandTypes cts);
void CommandTypeFilter(CommandTypes &input, CommandTypes &output, CommandClass cc);
};
/**