Package sfs3.client.entities
Class MMOItem
java.lang.Object
sfs3.client.entities.MMOItem
- All Implemented Interfaces:
IMMOItem
An MMOItem represents an active non-player entity inside an MMORoom.
MMOItems can be used to represent bonuses, triggers, bullets, etc, or any other non-player entity that will be handled using the MMORoom's rules of visibility. This means that whenever one or more MMOItems fall within the Area of Interest of a user, their presence will be notified to that user by means of the SFSEvent.PROXIMITY_LIST_UPDATE event.
MMOItems are identified by a unique ID and can have one or more MMOItem Variables associated to store custom data.
NOTE: MMOItems can be created in a server side Extension only; client side creation is not allowed.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsVariable(String name) Indicates whether this MMOItem has the specified Item Variable set or not.booleanstatic IMMOItemfromSFSArray(ISFSArray encodedItem) Returns the entry point within the User's AOI where this object "appeared" with the last PROXIMITY_LIST_UPDATE event.intgetId()The unique ID of this itemgetVariable(String name) Retrieves a User Variable from its name.Retrieves all the Variables of this IteminthashCode()voidsetAOIEntryPoint(Vec3D aoiEntryPoint) voidprivatevoidsetVariables(List<IMMOItemVariable> varList) privatetoString()
-
Constructor Details
-
MMOItem
public MMOItem(int id)
-
-
Method Details
-
fromSFSArray
-
containsVariable
Indicates whether this MMOItem has the specified Item Variable set or not.- Specified by:
containsVariablein interfaceIMMOItem- Parameters:
name- The name of the MMOItemVariable whose existence must be checked.- Returns:
- true if a MMOItemVariable with the passed name exists for this MMOItem.
-
getAOIEntryPoint
Returns the entry point within the User's AOI where this object "appeared" with the last PROXIMITY_LIST_UPDATE event. This field is populated only if the MMORoom is configured to receive this data.- Specified by:
getAOIEntryPointin interfaceIMMOItem- See Also:
-
setAOIEntryPoint
-
getId
public int getId()The unique ID of this item -
getVariable
Retrieves a User Variable from its name.- Specified by:
getVariablein interfaceIMMOItem- Parameters:
name- The name of the User Variable to be retrieved.- Returns:
- The MMOItemVariable, or null if no MMOItemVariable with the passed name is associated with this MMOItem.
- See Also:
-
getVariables
Retrieves all the Variables of this Item- Specified by:
getVariablesin interfaceIMMOItem- Returns:
- The list of ItemVariable objects associated with the Item
- See Also:
-
setVariable
private- Specified by:
setVariablein interfaceIMMOItem
-
setVariables
private- Specified by:
setVariablesin interfaceIMMOItem
-
equals
-
hashCode
public int hashCode() -
toString
-