@@ -57,32 +57,40 @@ public TilePosition getTargetTilePosition() {
5757 return posComs .contains (type ) ? new TilePosition (x , y ) : new TilePosition (x / 32 , y / 32 );
5858 }
5959
60- private static Set <UnitCommandType > unitTypeComs = new HashSet <>(
61- Arrays .asList (Build , Build_Addon , Train , Morph )
62- );
6360 public UnitType getUnitType () {
64- return unitTypeComs .contains (type ) ? UnitType .unitTypes [extra ] : UnitType .None ;
61+ if (type == Build || type == Build_Addon || type == Train || type == Morph ) {
62+ return UnitType .unitTypes [extra ];
63+ }
64+ return UnitType .None ;
6565 }
6666
67- private static Set <UnitCommandType > techComs = new HashSet <>(
68- Arrays .asList (Research , Use_Tech , Use_Tech_Position , Use_Tech_Unit )
69- );
70-
7167 public TechType getTechType () {
72- return techComs .contains (type ) ? TechType .techTypes [extra ] : TechType .None ;
68+ if (type == Research || type == Use_Tech || type == Use_Tech_Position || type == Use_Tech_Unit ) {
69+ return TechType .techTypes [extra ];
70+ }
71+ return TechType .None ;
7372 }
7473
7574 public UpgradeType getUpgradeType () {
7675 return type == UnitCommandType .Upgrade ? UpgradeType .upgradeTypes [extra ] : UpgradeType .None ;
7776 }
7877
79- private static Set <UnitCommandType > queuables = new HashSet <>(
80- Arrays .asList (Attack_Move , Attack_Unit , Move , Patrol , Hold_Position , Stop , Follow , Gather , Return_Cargo ,
81- Repair , Load , Unload_All , Unload_All_Position , Right_Click_Position , Right_Click_Unit )
82- );
83-
8478 public boolean isQueued () {
85- return queuables .contains (type ) && extra != 0 ;
79+ return (type == Attack_Move ||
80+ type == Attack_Unit ||
81+ type == Move ||
82+ type == Patrol ||
83+ type == Hold_Position ||
84+ type == Stop ||
85+ type == Follow ||
86+ type == Gather ||
87+ type == Return_Cargo ||
88+ type == Load ||
89+ type == Unload_All ||
90+ type == Unload_All_Position ||
91+ type == Right_Click_Position ||
92+ type == Right_Click_Unit )
93+ && extra != 0 ;
8694 }
8795
8896 @ Override
0 commit comments