private void checkTargetDistance ( double dist ) { if ( distAttack . includes ( dist ) ) { if ( checker . canAttack ( ) ) { state = AttackState . ATTACKING ; } } else if ( tick . elapsed ( attackPause ) ) { for ( final AttackerListener listener : listeners ) { listener . notifyReachingTarget ( target ) ; } } }
Check the target distance and update the attack state .