refactor: remove some useles code
This commit is contained in:
parent
78a3eb1abb
commit
a0c8383be0
|
@ -1272,7 +1272,9 @@ void UnitType::sortCommandTypes(CommandTypes cts){
|
||||||
|
|
||||||
//Cores
|
//Cores
|
||||||
for(auto &&cc : CommandHelper::getCoresCC()){
|
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();
|
int nullCount = 4 - ctCores.size();
|
||||||
for(int i=0; i<nullCount; i++){
|
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 CommandType* UnitType::findCommandTypeById(int id) const{
|
||||||
const HarvestEmergencyReturnCommandType *result = dynamic_cast<const HarvestEmergencyReturnCommandType *>(ctHarvestEmergencyReturnCommandType.get());
|
const HarvestEmergencyReturnCommandType *result = dynamic_cast<const HarvestEmergencyReturnCommandType *>(ctHarvestEmergencyReturnCommandType.get());
|
||||||
if(result != NULL && id == result->getId()) {
|
if(result != NULL && id == result->getId()) {
|
||||||
|
|
|
@ -365,7 +365,6 @@ private:
|
||||||
void computeFirstStOfClass();
|
void computeFirstStOfClass();
|
||||||
void computeFirstCtOfClass();
|
void computeFirstCtOfClass();
|
||||||
void sortCommandTypes(CommandTypes cts);
|
void sortCommandTypes(CommandTypes cts);
|
||||||
void CommandTypeFilter(CommandTypes &input, CommandTypes &output, CommandClass cc);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue