<commit_before>package engine.sprites;

import javafx.geometry.Point2D;
import engine.InsufficientParametersException;


/**
 * This represents the general class for all game elements. All elements will contain methods which
 * return a boolean indicating if another type is able to target or collide with it.
 * 
 * @author <NAME>
 *
 */
public abstract class Sprite {
    private Point2D myLocation;
    private String myType;

    public Sprite () throws InsufficientParametersException {

    }

    // public abstract List<String> getParameters ();

    // public double getSize () {
    // return 0;
    // }

    // Setters and getters

    /**
     * Sets the location of the sprite
     * 
     * @param location Point2D object representing (x, y) coordinates
     */
    protected void setLocation (Point2D location) {
        myLocation = location;
    }

    /**
     * Sets the location of the sprite
     * 
     * @param x double of x-coordinate
     * @param y double of y-coordinate
     */
    protected void setLocation (double x, double y) {
        myLocation = new Point2D(x, y);
    }

    /**
     * Sets the type of object this is as an uppercase string
     * 
     * @param type String of the type of object
     */
    protected void setType (String type) {
        myType = type.toUpperCase();
    }

    /**
     * @return uppercase String of the type of object this is
     */
    protected String getType () {
        return myType;
    }

    // Abstract methods

    /**
     * Finds if a certain type of object can target this object
     * 
     * @param type String
     * @return true if the given type can target this object's type
     */
    public abstract boolean isTargetableBy (String type);

    /**
     * Finds if a certain type of object can collide with this object
     * 
     * @param type String
     * @return true if the given type can collide with this object's type
     */
    public abstract boolean isCollidableWith (String type);

}
<commit_msg>Add parameters instance variables to all sprites<commit_after>package engine.sprites;

import java.util.Map;
import javafx.geometry.Point2D;
import engine.InsufficientParametersException;


/**
 * This represents the general class for all game elements. All elements will contain methods which
 * return a boolean indicating if another type is able to target or collide with it.
 * 
 * @author <NAME>
 *
 */
public abstract class Sprite {

    /**
     * Holds the parameters of each object, like health/power/defense/etc
     */
    private Map<String, Object> myParameters;
    private Point2D myLocation;
    private String myType;

    public Sprite () throws InsufficientParametersException {

    }

    // public abstract List<String> getParameters ();

    // public double getSize () {
    // return 0;
    // }

    // Setters and getters

    /**
     * Loads an map of strings of parameters names to the object that carries their value
     * 
     * @param map of string to object
     */
    protected void setParameterMap (Map<String, Object> map) {
        myParameters = map;
    }

    /**
     * Returns the specified parameter
     * 
     * @param name String of the parameter
     * @return Object of a certain type representing value of name
     */
    protected Object getParameter (String name) {
        return myParameters.get(name);
    }

    /**
     * Sets the location of the sprite
     * 
     * @param location Point2D object representing (x, y) coordinates
     */
    protected void setLocation (Point2D location) {
        myLocation = location;
    }

    /**
     * Sets the location of the sprite
     * 
     * @param x double of x-coordinate
     * @param y double of y-coordinate
     */
    protected void setLocation (double x, double y) {
        myLocation = new Point2D(x, y);
    }

    /**
     * Sets the type of object this is as an uppercase string
     * 
     * @param type String of the type of object
     */
    protected void setType (String type) {
        myType = type.toUpperCase();
    }

    /**
     * @return uppercase String of the type of object this is
     */
    protected String getType () {
        return myType;
    }

    // Abstract methods

    /**
     * Finds if a certain type of object can target this object
     * 
     * @param type String
     * @return true if the given type can target this object's type
     */
    public abstract boolean isTargetableBy (String type);

    /**
     * Finds if a certain type of object can collide with this object
     * 
     * @param type String
     * @return true if the given type can collide with this object's type
     */
    public abstract boolean isCollidableWith (String type);

}

{'fraction_non_alphanumeric': 0.07742754389676328, 'fraction_numerical': 0.0025386079966151893, 'mean_word_length': 2.3016759776536313, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4203647', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1233, 'n_words': 514}