| 2652 | return true; |
| 2653 | } |
| 2654 | static inline bool canIssueCommandTypeGrouped(Unit thisUnit, BWAPI::UnitCommandType ct, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) |
| 2655 | { |
| 2656 | if ( !checkCommandibility ) |
| 2657 | Broodwar->setLastError(); |
| 2658 | else if ( !canCommand(thisUnit) ) |
| 2659 | return false; |
| 2660 | |
| 2661 | if ( checkCommandibilityGrouped && !canCommandGrouped(thisUnit, false) ) |
| 2662 | return false; |
| 2663 | |
| 2664 | switch (ct) |
| 2665 | { |
| 2666 | case UnitCommandTypes::Enum::Attack_Move: |
| 2667 | return canAttackMoveGrouped(thisUnit, false, false); |
| 2668 | |
| 2669 | case UnitCommandTypes::Enum::Attack_Unit: |
| 2670 | return canAttackUnitGrouped(thisUnit, false, false); |
| 2671 | |
| 2672 | case UnitCommandTypes::Enum::Build: |
| 2673 | return false; |
| 2674 | |
| 2675 | case UnitCommandTypes::Enum::Build_Addon: |
| 2676 | return false; |
| 2677 | |
| 2678 | case UnitCommandTypes::Enum::Train: |
| 2679 | return canTrain(thisUnit, false); |
| 2680 | |
| 2681 | case UnitCommandTypes::Enum::Morph: |
| 2682 | return canMorph(thisUnit, false); |
| 2683 | |
| 2684 | case UnitCommandTypes::Enum::Research: |
| 2685 | return false; |
| 2686 | |
| 2687 | case UnitCommandTypes::Enum::Upgrade: |
| 2688 | return false; |
| 2689 | |
| 2690 | case UnitCommandTypes::Enum::Set_Rally_Position: |
| 2691 | return false; |
| 2692 | |
| 2693 | case UnitCommandTypes::Enum::Set_Rally_Unit: |
| 2694 | return false; |
| 2695 | |
| 2696 | case UnitCommandTypes::Enum::Move: |
| 2697 | return canMoveGrouped(thisUnit, false, false); |
| 2698 | |
| 2699 | case UnitCommandTypes::Enum::Patrol: |
| 2700 | return canPatrolGrouped(thisUnit, false, false); |
| 2701 | |
| 2702 | case UnitCommandTypes::Enum::Hold_Position: |
| 2703 | return canHoldPosition(thisUnit, false); |
| 2704 | |
| 2705 | case UnitCommandTypes::Enum::Stop: |
| 2706 | return canStop(thisUnit, false); |
| 2707 | |
| 2708 | case UnitCommandTypes::Enum::Follow: |
| 2709 | return canFollow(thisUnit, false); |
| 2710 | |
| 2711 | case UnitCommandTypes::Enum::Gather: |
no test coverage detected