- remove unneeded instanceof and casting in Material

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8821 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
nor..67 2011-11-27 13:46:51 +00:00
parent 212b57ecc6
commit 4e66dddc95

View File

@ -202,6 +202,14 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
return m.getSortId() - getSortId();
}
@Override
public boolean equals(Object obj) {
if(obj instanceof Material){
return ((Material)obj).compareTo(this) == 0;
}
return super.equals(obj);
}
/**
* Clones this material. The result is returned.
*/
@ -331,10 +339,7 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
*/
public MatParam getParam(String name) {
MatParam param = paramValues.get(name);
if (param instanceof MatParam) {
return (MatParam) param;
}
return null;
return param;
}
/**