public interface IWorldObjectUpdatedEvent extends IWorldChangeEvent
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.
| Modifier and Type | Interface and Description |
|---|---|
static class |
IWorldObjectUpdatedEvent.DestroyWorldObject
Shortcut implementation of
IWorldObjectUpdatedEvent that informs that some object has been destroyed. |
| Modifier and Type | Method and Description |
|---|---|
WorldObjectId |
getId() |
IWorldObjectUpdateResult<IWorldObject> |
update(IWorldObject obj) |
getSimTimeWorldObjectId getId()
IWorldObjectUpdateResult<IWorldObject> update(IWorldObject obj)
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.