<commit_before>package voogasalad_GucciGames.gameEngine.gameConditions.defaultConditions;

import java.util.Map;

import voogasalad_GucciGames.gameEngine.CommunicationParameters.BasicParameters;
import voogasalad_GucciGames.gameEngine.gameConditions.Conditions;
import voogasalad_GucciGames.gameEngine.gamePlayer.GamePlayerPerson;

/**
 *
 * @author <NAME>
 *
 */
public class CheckSteppingOn extends Conditions {
	private static final String TARGET_TYPE = "targetType";
	private String myType;

	public CheckSteppingOn(Map<String, Object> condParams) {
		super(condParams);
		if (condParams.containsKey(TARGET_TYPE)) {
			myType = (String) condParams.get(TARGET_TYPE);
		}
	}

	@Override
	public Boolean execute(BasicParameters params, GamePlayerPerson player) {
		return null;
	}

}<commit_msg>created checkSteppingOn condition<commit_after>package voogasalad_GucciGames.gameEngine.gameConditions.defaultConditions;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import voogasalad_GucciGames.gameEngine.CommunicationParameters.BasicParameters;
import voogasalad_GucciGames.gameEngine.gameConditions.Conditions;
import voogasalad_GucciGames.gameEngine.gamePlayer.GamePlayerPerson;
import voogasalad_GucciGames.gameEngine.mapObject.MapObject;
import voogasalad_GucciGames.gameEngine.targetCoordinate.TargetCoordinateSingle;

/**
 *
 * @author <NAME>
 *
 */
public class CheckSteppingOn extends Conditions {
	private static final String TARGET_TYPE = "targetType";
	private String myType;

	public CheckSteppingOn(Map<String, Object> condParams) {
		super(condParams);
		if (condParams.containsKey(TARGET_TYPE)) {
			myType = (String) condParams.get(TARGET_TYPE);
		}
	}

	@Override
	public Boolean execute(BasicParameters params, GamePlayerPerson player) {
		MapObject calledMe = params.getCalledMe();
		TargetCoordinateSingle myLocation = (TargetCoordinateSingle) calledMe.getCoordinate();
		List<Integer> ids = extractAllPlayersExceptNutral(params);
		for (Integer id : ids) {
			List<MapObject> currPlayerObjects = params.getEngine().getPlayers().getPlayerById(id).getMapObjects();

			for (int i = 0; i < currPlayerObjects.size(); i++) {
				MapObject mo = currPlayerObjects.get(i);
				if (mo.getCoordinate().equals(myLocation) && mo.getName().equals(myType)) {

					return true;
				}
			}
		}
		return false;

	}

	private List<Integer> extractAllPlayersExceptNutral(BasicParameters params) {
		List<Integer> ids1 = params.getEngine().getPlayers().getAllIds();
		List<Integer> ids = new ArrayList<Integer>();
		for (int i = 1; i < ids1.size(); i++) {
			ids.add(ids1.get(i));
		}
		return ids;
	}
}
{'fraction_non_alphanumeric': 0.10630220197418375, 'fraction_numerical': 0.0018982536066818527, 'mean_word_length': 5.952506596306069, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, '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': '5760827', 'n_tokens_mistral': 908, 'n_tokens_neox': 835, 'n_words': 153}