package engine.gameobject.labels;

import engine.fieldsetting.Settable;


@Settable
public class SimpleType implements Type{

    private Type superType;
    private String myName;

    public SimpleType () {
        superType = new TypeBase();
        myName = " ";
    }

    public SimpleType (String name) {
        myName = name;
        superType = new TypeBase();
    }

    public SimpleType (String name, Type parent) {
        myName = name;
        superType = parent;
    }

    @Override
    @Settable
    public void setName (String name) {
        myName = name;
    }

    @Override
    public String getName () {
        return myName;
    }

    @Override
    @Settable
    public void setSuperType (Type parent) {
        superType = parent;
    }

    @Override
    public Type getSuperType () {
        return superType;
    }

    @Override
    public Type clone () {
        return new SimpleType(myName, superType);
    }

    @Override
    public int hashCode(){
        return 7 * myName.hashCode() + 97 * superType.hashCode();
    }
    
    // TODO: equals method needs work... possibly should go all the way down to basetype
    @Override
    public boolean equals (Object other) {
        return hashCode() == other.hashCode();
    }
}

@@ -116,16 +116,17 @@
 nts Type
+ 
 %7B%0A%0A    p
@@ -978,18 +978,20 @@
 hashCode
+ 
 ()
+ 
 %7B%0A      
@@ -1060,102 +1060,9 @@
   %7D%0A
-    %0A    // TODO: equals method needs work... possibly should go all the way down to basetype
 %0A
+
     
@@ -1110,24 +1110,24 @@
 ct other) %7B%0A
-
         retu
@@ -1128,16 +1128,33 @@
   return
+ other != null &&
  hashCod

fix equals method