<commit_before>package gameEngine.actors.behaviors;

import gameEngine.actors.BaseActor;

public class SimpleDefense extends BaseDefendBehavior{
    public SimpleDefense(double health){
        super(health);
    }

    @Override
    public void execute (BaseActor actor) {
        for(BaseActor a: actor.getInfoObject().getProjectilesInRange()){
            myHealth--;
            a.died();
            if(myHealth==0)
                actor.died();
        }
    }

    @Override
    public IBehavior copy () {
        return new SimpleDefense(myInitialHealth);
    }
}<commit_msg>updated simpleDefense<commit_after>package gameEngine.actors.behaviors;

import gameEngine.actors.BaseActor;

public class SimpleDefense extends BaseDefendBehavior{
    public SimpleDefense(double health){
        super(health);
    }

    @Override
    public void execute (BaseActor actor) {
        for(BaseActor a: actor.getInfoObject().getProjectilesInRange()){
            if(actor.getNode().intersects(a.getRange().getBoundsInLocal())){
            myHealth--;
            a.died();
            if(myHealth==0)
                actor.died();
        }
        }
    }

    @Override
    public IBehavior copy () {
        return new SimpleDefense(myInitialHealth);
    }
}
{'fraction_non_alphanumeric': 0.10309278350515463, 'fraction_numerical': 0.0015860428231562252, 'mean_word_length': 2.4293478260869565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1364731', 'n_tokens_mistral': 360, 'n_tokens_neox': 344, 'n_words': 68}