public abstract class AbstractSharedProperty<TYPE> extends Object implements ISharedProperty<TYPE>
SharedProperties are generally derived from bot's subjective observation of the world (local properties). If the local properties, which are used to derive the value of the sharedProperty are dated, the sharedProperty is considered "dirty", because the value might be wrong, the team that owns this property only assumes the value.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractSharedProperty.GenericPropertyUpdate |
| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
compositeClass |
protected boolean |
dirty |
protected PropertyId |
propertyId |
protected TYPE |
value |
| Constructor and Description |
|---|
AbstractSharedProperty(AbstractSharedProperty source)
Used in copy-constructors,
when writing a copy constructor for a descendant class, you must add a clone for value.
|
AbstractSharedProperty(WorldObjectId objectId,
String identifier,
Class compositeClass)
Used in propertyConstructors from data.
|
AbstractSharedProperty(WorldObjectId objId,
String identifier,
TYPE value,
Class<?> compositeClass) |
| Modifier and Type | Method and Description |
|---|---|
abstract ISharedProperty<TYPE> |
clone()
Must return an exact duplicate of this ISharedProperty, this will be used
to create old versions of SharedProperties in the worldView.
|
protected abstract TYPE |
cloneValue()
Every descendant must implement this by calling value.clone() or otherwise returning a new copy of value.
|
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.
|
boolean |
equals(Object another) |
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.
|
TYPE |
getValue()
Returns value of the property.
|
int |
hashCode() |
boolean |
isDirty()
SharedProperties are generally properties derived from bot's observation of the world.
|
boolean |
nullOverrides() |
void |
setDirty(boolean value) |
void |
setValue(TYPE value)
Sets the value of the property - should be used by Pogamut Library developers only!
|
finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetPropertyValueClassprotected PropertyId propertyId
protected boolean dirty
protected Class<?> compositeClass
protected TYPE value
public AbstractSharedProperty(WorldObjectId objId, String identifier, TYPE value, Class<?> compositeClass)
public AbstractSharedProperty(AbstractSharedProperty source)
source - public AbstractSharedProperty(WorldObjectId objectId, String identifier, Class compositeClass)
objectId - identifier - compositeClass - public boolean nullOverrides()
nullOverrides in interface ISharedProperty<TYPE>protected abstract TYPE cloneValue()
public abstract ISharedProperty<TYPE> clone()
ISharedPropertyclone in interface ISharedProperty<TYPE>clone in class Objectpublic TYPE getValue()
ISharedPropertygetValue in interface ISharedProperty<TYPE>public void setValue(TYPE value)
ISharedPropertysetValue in interface ISharedProperty<TYPE>public Class getCompositeClass()
ISharedPropertygetCompositeClass in interface ISharedProperty<TYPE>public boolean isDirty()
ISharedPropertyisDirty in interface ISharedProperty<TYPE>public void setDirty(boolean value)
public WorldObjectId getObjectId()
ISharedPropertygetObjectId in interface ISharedProperty<TYPE>public PropertyId getPropertyId()
ISharedPropertygetPropertyId in interface ISharedProperty<TYPE>public ISharedPropertyUpdatedEvent createUpdateEvent(long time, ITeamId teamId)
ISharedPropertycreateUpdateEvent in interface ISharedProperty<TYPE>Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.