int id = examined.getId();
// add the knowledge about the position if it did not exist so far:
if(this._positionsFar.containsKey(id)){
Position remembered = this._positionsFar.get(id);
if(remembered.matchesFromFar(examined) == false){
this._positionsFar.remove(id);
Position ourCopy = examined.examinedFromFar();
this._positionsFar.put(id, ourCopy);
if(ourCopy.isTypeOf(BaseInterface.Type.CONTAINER))
this.seenContents((Container)ourCopy);
seenSomethingNew = true;
}
return seenSomethingNew;
}
if(this._positionsNear.containsKey(id)){
Position remembered = this._positionsNear.get(id);
if(remembered.matchesFromFar(examined) == false){
Position oldPosition = this._positionsNear.remove(id);
Position ourCopy = examined.examinedFromFar();
this._positionsFar.put(id, ourCopy);
if(ourCopy.isTypeOf(BaseInterface.Type.CONTAINER)){
this.seenContents((Container)ourCopy);
// don't forget the old items either:
((Container)ourCopy).addItems(((Container)oldPosition).getItems());
}
seenSomethingNew = true;
}
return seenSomethingNew;
}
// no list contains it yet:
Position ourCopy = examined.examinedFromFar();
this._positionsFar.put(id, ourCopy);
if(ourCopy.isTypeOf(BaseInterface.Type.CONTAINER))
this.seenContents((Container)ourCopy);
seenSomethingNew = true;
// add parent room to room list: