From: Matthias T. <mt...@us...> - 2005-11-17 07:02:34
|
Update of /cvsroot/arianne/marauroa/src/marauroa/common/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17730/src/marauroa/common/game Modified Files: RPSlot.java Log Message: * reverted to not expose implementation details Index: RPSlot.java =================================================================== RCS file: /cvsroot/arianne/marauroa/src/marauroa/common/game/RPSlot.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RPSlot.java 16 Nov 2005 18:28:37 -0000 1.16 --- RPSlot.java 17 Nov 2005 07:02:26 -0000 1.17 *************** *** 211,220 **** public RPObject get(RPObject.ID id) throws RPObjectNotFoundException { - return get(id.getObjectID()); - } - - /** Gets the object from the slot */ - private RPObject get(int objectId) throws RPObjectNotFoundException - { try { --- 211,214 ---- *************** *** 222,236 **** { // We compare only the id, as the zone is really irrelevant ! if(object.getID().getObjectID() == objectId) { return object; } } ! throw new RPObjectNotFoundException(new RPObject.ID(objectId,"")); } catch(AttributeNotFoundException e) { logger.warn("error getting object",e); ! throw new RPObjectNotFoundException(new RPObject.ID(objectId,"")); } } --- 216,230 ---- { // We compare only the id, as the zone is really irrelevant ! if(object.getID().getObjectID() == id.getObjectID()) { return object; } } ! throw new RPObjectNotFoundException(id); } catch(AttributeNotFoundException e) { logger.warn("error getting object",e); ! throw new RPObjectNotFoundException(id); } } *************** *** 239,248 **** public RPObject remove(RPObject.ID id) throws RPObjectNotFoundException { - return remove(id.getObjectID()); - } - - /** This method removes the object from the slot */ - private RPObject remove(int objectId) throws RPObjectNotFoundException - { try { --- 233,236 ---- *************** *** 254,258 **** /** We compare only the id, as the zone is really irrelevant */ ! if(object.getID().getObjectID() == objectId) { /* HACK: This is a hack to avoid a problem that happens when on the --- 242,246 ---- /** We compare only the id, as the zone is really irrelevant */ ! if(object.getID().getObjectID() == id.getObjectID()) { /* HACK: This is a hack to avoid a problem that happens when on the *************** *** 263,267 **** { RPObject added_object=added_it.next(); ! if(objectId == added_object.getID().getObjectID()) { added_it.remove(); --- 251,255 ---- { RPObject added_object=added_it.next(); ! if(added_object.getID().getObjectID() == id.getObjectID()) { added_it.remove(); *************** *** 282,291 **** } } ! throw new RPObjectNotFoundException(new RPObject.ID(objectId,"")); } catch(AttributeNotFoundException e) { logger.warn("error removing object",e); ! throw new RPObjectNotFoundException(new RPObject.ID(objectId,"")); } } --- 270,279 ---- } } ! throw new RPObjectNotFoundException(id); } catch(AttributeNotFoundException e) { logger.warn("error removing object",e); ! throw new RPObjectNotFoundException(id); } } |