<commit_before>package com.print_stack_trace.voogasalad.model.engine.runtime;

import com.print_stack_trace.voogasalad.model.engine.physics.CollisionDetector;
import com.print_stack_trace.voogasalad.model.environment.Goal;
import com.print_stack_trace.voogasalad.model.environment.GoalElementVisitor;
import com.print_stack_trace.voogasalad.model.environment.KillBoss;
import com.print_stack_trace.voogasalad.model.environment.Points;
import com.print_stack_trace.voogasalad.model.environment.ReachDistance;
import com.print_stack_trace.voogasalad.model.environment.ReachObject;
import com.print_stack_trace.voogasalad.model.environment.StayAlive;

public class GoalChecker implements GoalElementVisitor {
	private static final int GOAL_DESTINATION_BUFFER = 2;
	private RuntimeModel myLevel;

	public GoalChecker(RuntimeModel level) {
		myLevel = level;
	}

	@Override
	public boolean visit(KillBoss goal) {
		return myLevel.getRuntimeSpriteMap().get(goal.getBossID()).startingHealth <= 0;
	}

	@Override
	public boolean visit(Points goal) {
		return myLevel.currentPoints >= goal.reqPoints;
	}

	@Override
	public boolean visit(ReachDistance goal) {
		double heroPosition = 0;
		if(goal.isHorizontal()){
			heroPosition = myLevel.getRuntimeSpriteMap().get(goal.getHeroID()).p.getX();
		}
		else{
			heroPosition = myLevel.getRuntimeSpriteMap().get(goal.getHeroID()).p.getY();
		}
		return (heroPosition > (goal.getDestination() - GOAL_DESTINATION_BUFFER)) 
				&& (heroPosition < (goal.getDestination() + GOAL_DESTINATION_BUFFER )); }


	@Override
	public boolean visit(ReachObject goal) {
		return CollisionDetector.haveCollided(myLevel.getRuntimeSpriteMap().get(goal.getMySpriteID()), 
				myLevel.getRuntimeSpriteMap().get(goal.getMyObjectiveID()));
	}


	@Override
	public boolean visit(StayAlive goal) {
		return myLevel.getRuntimeSpriteMap().get(goal.getHeroID()).health <= 0;
	}

	@Override
	public boolean visit(Goal goal) {
		return false;
	}

}
<commit_msg>fixed x and y point issues<commit_after>package com.print_stack_trace.voogasalad.model.engine.runtime;

import com.print_stack_trace.voogasalad.model.engine.physics.CollisionDetector;
import com.print_stack_trace.voogasalad.model.environment.Goal;
import com.print_stack_trace.voogasalad.model.environment.GoalElementVisitor;
import com.print_stack_trace.voogasalad.model.environment.KillBoss;
import com.print_stack_trace.voogasalad.model.environment.Points;
import com.print_stack_trace.voogasalad.model.environment.ReachDistance;
import com.print_stack_trace.voogasalad.model.environment.ReachObject;
import com.print_stack_trace.voogasalad.model.environment.StayAlive;

public class GoalChecker implements GoalElementVisitor {
	private static final int GOAL_DESTINATION_BUFFER = 2;
	private RuntimeModel myLevel;

	public GoalChecker(RuntimeModel level) {
		myLevel = level;
	}

	@Override
	public boolean visit(KillBoss goal) {
		return myLevel.getRuntimeSpriteMap().get(goal.getBossID()).startingHealth <= 0;
	}

	@Override
	public boolean visit(Points goal) {
		return myLevel.currentPoints >= goal.reqPoints;
	}

	@Override
	public boolean visit(ReachDistance goal) {
		double heroPosition = 0;
		if(goal.isHorizontal()){
			heroPosition = myLevel.getRuntimeSpriteMap().get(goal.getHeroID()).getX();
		}
		else{
			heroPosition = myLevel.getRuntimeSpriteMap().get(goal.getHeroID()).getY();
		}
		return (heroPosition > (goal.getDestination() - GOAL_DESTINATION_BUFFER)) 
				&& (heroPosition < (goal.getDestination() + GOAL_DESTINATION_BUFFER )); }


	@Override
	public boolean visit(ReachObject goal) {
		return CollisionDetector.haveCollided(myLevel.getRuntimeSpriteMap().get(goal.getMySpriteID()), 
				myLevel.getRuntimeSpriteMap().get(goal.getMyObjectiveID()));
	}


	@Override
	public boolean visit(StayAlive goal) {
		return myLevel.getRuntimeSpriteMap().get(goal.getHeroID()).health <= 0;
	}

	@Override
	public boolean visit(Goal goal) {
		return false;
	}

}

{'fraction_non_alphanumeric': 0.10899873257287707, 'fraction_numerical': 0.0020278833967046894, 'mean_word_length': 6.0213523131672595, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6126364', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1319, 'n_words': 199}