Speaking from experience, it is really easy to forget to update all necessary variables when some are linked like this. Instead of having haloDriveEnabled and tankDriveEnabled, you should use an int for driveMode and private static final ints to represent something like MODE_HALO_DRIVE = 0MODE_TANK_DRIVE = 1, etc and check if driveMode == one of those (this way you could also have more than 2 states)
Speaking from experience, it is really easy to forget to update all necessary variables when some are linked like this. Instead of having
haloDriveEnabled
andtankDriveEnabled
, you should use an int fordriveMode
andprivate static final int
s to represent something likeMODE_HALO_DRIVE = 0
MODE_TANK_DRIVE = 1
, etc and check ifdriveMode ==
one of those (this way you could also have more than 2 states)