Class SFS2X.Entities.MMOItem
The representation of an active non-player entity inside an MMORoom.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new MMOItem instance.
|
Field Summary
Method Summary
Class Detail
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 proximityListUpdate 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.
- Parameters:
- {Number} id
- The item id.
Field Detail
The returned coordinates are those that the item had when its presence in the current user's Area of Interest was last notified by a proximityListUpdate event. This field is populated only if the MMORoom in which the item exists is configured to receive such data.
NOTE: the id is unique and it is generated by the server when the MMOItem is created. Setting it manually has no effect on the server and can disrupt the API functioning.
Method Detail
-
{Boolean} containsVariable(varName)Indicates whether this item has the specified MMOItem Variable set or not.
- Parameters:
- {String} varName
- The name of the MMOItem Variable whose existance must be checked.
- Returns:
- {Boolean}
true
if an MMOItem Variable with the passed name is set for this item.
-
{MMOItemVariable} getVariable(varName)Retrieves an MMOItem Variable from its name.
- Parameters:
- {String} varName
- The name of the MMOItem Variable to be retrieved.
- Returns:
- {MMOItemVariable} The MMOItemVariable object, or
null
if no MMOItem Variable with the passed name is associated to this item. - See also:
- SFS2X.Entities.Variables.MMOItemVariable
- SFS2X.Requests.MMO.SetMMOItemVariablesRequest
-
{Array} getVariables()Retrieves all the MMOItem Variables of this item.
- Returns:
- {Array} The list of MMOItemVariable objects associated to this item.
- See also:
- SFS2X.Entities.Variables.MMOItemVariable
-
{String} toString()Returns a string that contains the item id.
- Returns:
- {String} The string representation of the MMOItem object.