From: Miguel A. B. L. <ari...@us...> - 2005-10-30 19:27:44
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/rule/defaultruleset In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1319/src/games/stendhal/server/rule/defaultruleset Modified Files: DefaultEntityManager.java Log Message: Added GM system Index: DefaultEntityManager.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/rule/defaultruleset/DefaultEntityManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DefaultEntityManager.java 2 Sep 2005 10:32:33 -0000 1.4 --- DefaultEntityManager.java 30 Oct 2005 19:27:33 -0000 1.5 *************** *** 174,177 **** --- 174,197 ---- } + public boolean isItem(int id) + { + if (id < 0) + return false; + + String clazz = idToClass.get(id); + if (clazz == null) + return false; + + return isItem(clazz); + } + + /** return true if the Entity is a creature */ + public boolean isItem(String clazz) + { + if (clazz == null) + throw new NullPointerException("entity class is null"); + return classToItem.containsKey(clazz); + } + /** * returns the item or <code>null</code> if the id is unknown |