MCPcopy Create free account
hub / github.com/bwapi/bwapi / canIssueCommandGrouped

Function canIssueCommandGrouped

bwapi/Shared/Templates.h:2946–3096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2944 return true;
2945 }
2946 static inline bool canIssueCommandGrouped(Unit thisUnit, UnitCommand c, bool checkCanUseTechPositionOnPositions = true, bool checkCanUseTechUnitOnUnits = true, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true)
2947 {
2948 if ( !checkCommandibility )
2949 Broodwar->setLastError();
2950 else if ( !canCommand(thisUnit) )
2951 return false;
2952
2953 if ( checkCommandibilityGrouped && !canCommandGrouped(thisUnit, false) )
2954 return false;
2955
2956 BWAPI::UnitCommandType ct = c.type;
2957 if ( checkCanIssueCommandType && !canIssueCommandTypeGrouped(thisUnit, ct, false, false) )
2958 return false;
2959
2960 switch (ct)
2961 {
2962 case UnitCommandTypes::Enum::Attack_Move:
2963 return true;
2964
2965 case UnitCommandTypes::Enum::Attack_Unit:
2966 return canAttackUnitGrouped(thisUnit, c.target, checkCanTargetUnit, false, false, false);
2967
2968 case UnitCommandTypes::Enum::Build:
2969 return false;
2970
2971 case UnitCommandTypes::Enum::Build_Addon:
2972 return false;
2973
2974 case UnitCommandTypes::Enum::Train:
2975 return canTrain(thisUnit, c.getUnitType(), false, false);
2976
2977 case UnitCommandTypes::Enum::Morph:
2978 return canMorph(thisUnit, c.getUnitType(), false, false);
2979
2980 case UnitCommandTypes::Enum::Research:
2981 return false;
2982
2983 case UnitCommandTypes::Enum::Upgrade:
2984 return false;
2985
2986 case UnitCommandTypes::Enum::Set_Rally_Position:
2987 return false;
2988
2989 case UnitCommandTypes::Enum::Set_Rally_Unit:
2990 return false;
2991
2992 case UnitCommandTypes::Enum::Move:
2993 return true;
2994
2995 case UnitCommandTypes::Enum::Patrol:
2996 return true;
2997
2998 case UnitCommandTypes::Enum::Hold_Position:
2999 return true;
3000
3001 case UnitCommandTypes::Enum::Stop:
3002 return true;
3003

Callers 1

Calls 15

canCommandFunction · 0.85
canCommandGroupedFunction · 0.85
canAttackUnitGroupedFunction · 0.85
canTrainFunction · 0.85
canMorphFunction · 0.85
canFollowFunction · 0.85
canGatherFunction · 0.85
canRepairFunction · 0.85
canLoadFunction · 0.85
canUnloadAllPositionFunction · 0.85
canRightClickUnitGroupedFunction · 0.85

Tested by

no test coverage detected