|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IWorldObjectUpdatedEvent
Interface for the event that suppose to update the informations about the object in the world.
Each event should return an id of the object it is meant to update, this
event is processed by the IWorldViewEventInput
implementor that should
look up the object in it's view and update it with the method defined
by the implementor of this interface.
Update event may have four different outcomes according to IWorldObjectUpdateResult.getResult()
.
IWorldObjectUpdateResult.Result
.CREATED = new object appeared in the world - this is the case when the object's id is
unknown to the world view thus 'null' is passed to the update() method AND update()
returns new world objectIWorldObjectUpdateResult.Result
.UPDATED = update state of the existing object in the world - this is the case
when the object's id is known to the world view so the according world object is passed
to the update() method AND update() returns the same instance (but updated, i.e., some of its fields changes)
of the world objectIWorldObjectUpdateResult.Result
.SAME = object was not updated (no new information has been set to it).
IWorldObjectUpdateResult.Result
.DESTROYED = object disappeared from the world - this is the case when the object's id
is known to the world and should be destroyed.
It's forbidden for the instance of update event to create a new world object instance in the 2) case, it must always work over the instance passed to the update() method
For the case 1), IWorldView
will generate WorldObjectFirstEncounteredEvent
followed
by WorldObjectUpdatedEvent
,
for the case 2) the world view will generate just WorldObjectUpdatedEvent
and for the case 4) WorldObjectDestroyedEvent
.
No event is generated for the case 3 as it does not bring new information.
Nested Class Summary | |
---|---|
static class |
IWorldObjectUpdatedEvent.DestroyWorldObject
Shortcut implementation of IWorldObjectUpdatedEvent that informs that some object has been destroyed. |
Method Summary | |
---|---|
WorldObjectId |
getId()
|
IWorldObjectUpdateResult<IWorldObject> |
update(IWorldObject obj)
|
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent |
---|
getSimTime |
Method Detail |
---|
WorldObjectId getId()
IWorldObjectUpdateResult<IWorldObject> update(IWorldObject obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |