Class AbstractEntity
java.lang.Object
idlab.colonyops.model.entities.AbstractEntity
- All Implemented Interfaces:
Entity
- Direct Known Subclasses:
HostileOrganism, LandingCraft, ResourceDeposit, ResourceDropOffPoint, SquadMember, Turret
Base implementation of
Entity shared by all concrete entity types, providing identity,
location, colony ownership, and identity-based equals(Object)/hashCode()
(based on id alone).-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractEntity(String id, Location location) protectedAbstractEntity(String id, Location location, String colonyId) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()inthashCode()voidsetColonyId(String colonyId) voidvoidsetLocation(Location location)
-
Field Details
-
id
-
location
-
colonyId
-
-
Constructor Details
-
AbstractEntity
protected AbstractEntity() -
AbstractEntity
-
AbstractEntity
-
-
Method Details
-
getId
-
setId
-
getLocation
- Specified by:
getLocationin interfaceEntity
-
setLocation
- Specified by:
setLocationin interfaceEntity
-
getColonyId
- Specified by:
getColonyIdin interfaceEntity- Returns:
- the identifier of the colony this entity belongs to, or
nullif it is not owned by any colony (e.g. aResourceDepositorHostileOrganism)
-
setColonyId
- Specified by:
setColonyIdin interfaceEntity
-
equals
-
hashCode
-