cz.cuni.amis.pogamut.multi.communication.worldview.object
Interface ISharedProperty<TYPE>

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
AbstractSharedProperty, BooleanProperty, ColorProperty, Dimension2DProperty, DoubleProperty, FloatProperty, IntegerProperty, IntProperty, ItemTypeProperty, LocationProperty, LongProperty, RotationProperty, StringProperty, UnrealIdProperty, Vector3dProperty, VelocityProperty

public interface ISharedProperty<TYPE>
extends java.lang.Cloneable

Interface for all shared properties in the world.

A shared property is subjective to a single team of game bots but it is objective to all bots in the same team. Generally, the shared properties will contain information, that is useful to the entire team and can be derived from single-bot observation. ( visible => spawned ; mover positions etc...). These inferred values can get dirty if the direct observation of the object is older than the origin of the property.

Also, sharedProperties can be used for team-coordination information, orders and such. In this case, the properties generally won't get dirty.


Method Summary
 ISharedProperty clone()
          Must return an exact duplicate of this ISharedProperty, this will be used to create old versions of SharedProperties in the worldView.
 ISharedPropertyUpdatedEvent createUpdateEvent(long time, ITeamId teamId)
          Creates an event updating a sharedProperty of the same id and the specified team to the same value as the parent property.
 java.lang.Class<?> getCompositeClass()
          Class of the compositeObject this property belongs to.
 WorldObjectId getObjectId()
          ObjectId of the object that this property is part of.
 PropertyId getPropertyId()
          Unique Id of this property.
 java.lang.Class<?> getPropertyValueClass()
          Returns class of the property value.
 TYPE getValue()
          Returns value of the property.
 boolean isDirty()
          SharedProperties are generally properties derived from bot's observation of the world.
 void setValue(TYPE value)
          Sets the value of the property - should be used by Pogamut Library developers only!
 

Method Detail

getValue

TYPE getValue()
Returns value of the property.

Returns:

setValue

void setValue(TYPE value)
Sets the value of the property - should be used by Pogamut Library developers only!

Parameters:
value -

clone

ISharedProperty clone()
Must return an exact duplicate of this ISharedProperty, this will be used to create old versions of SharedProperties in the worldView.

Returns:

getObjectId

WorldObjectId getObjectId()
ObjectId of the object that this property is part of.

Returns:

getPropertyId

PropertyId getPropertyId()
Unique Id of this property.

Returns:

isDirty

boolean isDirty()
SharedProperties are generally properties derived from bot's observation of the world. (like visible => spawned ). This may become a problem when the inferred information is outdated (ie. a bot can no longer see the spawned item, but the last time anybody from the team saw it, it was spawned). In this case, we consider the information "dirty", because the team only assumes the value. It can be wrong. (the game will always know the correct value of course, only our AI won't.

Returns:

getCompositeClass

java.lang.Class<?> getCompositeClass()
Class of the compositeObject this property belongs to.

Returns:

getPropertyValueClass

java.lang.Class<?> getPropertyValueClass()
Returns class of the property value. Used to enforce value-class checks.

Returns:

createUpdateEvent

ISharedPropertyUpdatedEvent createUpdateEvent(long time,
                                              ITeamId teamId)
Creates an event updating a sharedProperty of the same id and the specified team to the same value as the parent property.

Parameters:
time -
teamId -
Returns: