<commit_before>package com.inari.firefly.physics.collision;

import java.util.HashMap;

import com.inari.commons.geom.Rectangle;
import com.inari.commons.lang.aspect.Aspect;
import com.inari.commons.lang.list.DynArray;

public final class ContactScan {

    private final HashMap<String, ContactConstraint> constraintsNameMapping = new HashMap<String, ContactConstraint>();
    private final Rectangle unionArea = new Rectangle();
    
    final DynArray<ContactConstraint> constraints = DynArray.create( ContactConstraint.class );
    
    ContactScan() {}

    public final void update( float x, float y, float vx, float vy ) {
        for ( int i = 0; i < constraints.capacity(); i++ ) {
            ContactConstraint constraint = constraints.get( i );
            if ( constraint == null ) {
                continue;
            }
            
            constraint.update( x, y, vx, vy );
        }
    }

    public final boolean hasAnyContact() {
        for ( int i = 0; i < constraints.capacity(); i++ ) {
            ContactConstraint constraint = constraints.get( i );
            if ( constraint == null ) {
                continue;
            }
            
            if ( constraint.hasAnyContact() ) {
                return true;
            }<commit_msg>ContactScan<commit_after>package com.inari.firefly.physics.collision;

import java.util.HashMap;

import com.inari.commons.lang.aspect.Aspect;
import com.inari.commons.lang.list.DynArray;

public final class ContactScan {

    private final HashMap<String, ContactConstraint> constraintsNameMapping = new HashMap<String, ContactConstraint>();
    final DynArray<ContactConstraint> constraints = DynArray.create( ContactConstraint.class );
    
    ContactScan() {}

    public final void update( float x, float y, float vx, float vy ) {
        for ( int i = 0; i < constraints.capacity(); i++ ) {
            ContactConstraint constraint = constraints.get( i );
            if ( constraint == null ) {
                continue;
            }
            
            constraint.update( x, y, vx, vy );
        }
    }

    public final boolean hasAnyContact() {
        for ( int i = 0; i < constraints.capacity(); i++ ) {
            ContactConstraint constraint = constraints.get( i );
            if ( constraint == null ) {
                continue;
            }
            
            if ( constraint.hasAnyContact() ) {
                return true;
            }
{'fraction_non_alphanumeric': 0.10167415271539404, 'fraction_numerical': 0.0016333197223356473, 'mean_word_length': 2.0973451327433628, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5712024', 'n_tokens_mistral': 646, 'n_tokens_neox': 626, 'n_words': 170}