package model.state.gameelement;

/**
 * This is the manner in which all basic attributes will be encoded in a GameElement. Essentially is
 * a data wrapper around an attribute with a given name and given data. Intentionally has very
 * little functionality and is merely a data object.
 * 
 * @author Steve, Zach
 *
 * @param <T> - the type of attribute that is being encoded.
 */
public class Attribute<T> {

    private T myData;
    private String myName;

    /**
     * Create an attribute
     * 
     * @param name the attribute's name
     * @param data the data of the attribute
     */
    public Attribute (String name, T data) {
        myData = data;
        myName = name;
    }

    public String getName () {
        return myName;
    }

    public T getData () {
        return myData;
    }

    public void setData (T newData) {

        this.myData = newData;
    }

    @Override
    public String toString () {
        return myName + " : " + myData.toString();
    }

    @Override
    public boolean equals (Object arg) {
        if (!(arg instanceof Attribute)) return false;
        return this.hashCode() == arg.hashCode();
    }

    @Override
    public int hashCode () {
        return myName.hashCode();
    }

}

@@ -696,301 +696,1075 @@
     
-public String getName () %7B%0A        return myName;%0A    %7D%0A%0A    public T getData () %7B%0A        return myData;%0A    %7D%0A%0A    public void setData (T newData) %7B%0A%0A        this.myData = newData;%0A    %7D%0A%0A    @Override%0A    public String toString () %7B%0A        return myName + %22 : %22 + myData.toString();%0A    %7D%0A
+/**%0A     * Returns the name of the attribute%0A     * @return myName%0A     *         the name of the attribute%0A     */%0A    public String getName () %7B%0A        return myName;%0A    %7D%0A%0A    /**%0A     * Returns the data of the attribute%0A     * %0A     * @return myData%0A     *         the data of the attribute%0A     */%0A    public T getData () %7B%0A        return myData;%0A    %7D%0A%0A    /**%0A     * Sets the data of the attribute%0A     * %0A     * @param newData%0A     *        the data of the attribute to be set to%0A     */%0A    public void setData (T newData) %7B%0A%0A        this.myData = newData;%0A    %7D%0A%0A    /**%0A     * Returns the string of the attribute%0A     * %0A     * @return String%0A     *         a concatenated string of the name and data%0A     *         of the attribute%0A     */%0A    @Override%0A    public String toString () %7B%0A        return myName + %22 : %22 + myData.toString();%0A    %7D%0A%0A    /**%0A     * Returns true if the object's hashcodes are%0A     * the same%0A     * %0A     * @return boolean%0A     *         true if the object is the same%0A     *         false if the object is not the same%0A     */
 %0A   
@@ -1923,24 +1923,171 @@
 e();%0A    %7D%0A%0A
+    /**%0A     * Returns the hashcode of the attribute's name%0A     * %0A     * @return int%0A     *         the hashcode of the attribute's name%0A     */%0A
     @Overrid

improve comments in attributecontainer and attribute