Packagecom.smartfoxserver.v2.entities
Classpublic class MMOItem
InheritanceMMOItem Inheritance Object
Implements 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

MMORoom
MMOItemVariable


Public Properties
 PropertyDefined By
  aoiEntryPoint : Vec3D
Returns the entry point of this item in the current user's AoI.
MMOItem
  id : int
[read-only] Indicates the id of this item.
MMOItem
Public Methods
 MethodDefined By
  
MMOItem(id:int)
Creates a new MMOItem instance.
MMOItem
  
containsVariable(name:String):Boolean
Indicates whether this item has the specified MMOItem Variable set or not.
MMOItem
  
Retrieves an MMOItem Variable from its name.
MMOItem
  
getVariables():Array
Retrieves all the MMOItem Variables of this item.
MMOItem
  
setVariable(itemVariable:IMMOItemVariable):void
MMOItem
  
setVariables(itemVariables:Array):void
MMOItem
  
toString():String
Returns a string that contains the item id.
MMOItem
Property Detail
aoiEntryPointproperty
aoiEntryPoint:Vec3D

Returns the entry point of this item in the current user's AoI.

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 SFSEvent.PROXIMITY_LIST_UPDATE event. This field is populated only if the MMORoom in which the item exists is configured to receive such data.


Implementation
    public function get aoiEntryPoint():Vec3D
    public function set aoiEntryPoint(value:Vec3D):void
idproperty 
id:int  [read-only]

Indicates the id of this item. It is unique and it is generated by the server when the item is created.


Implementation
    public function get id():int
Constructor Detail
MMOItem()Constructor
public function MMOItem(id:int)

Creates a new MMOItem instance.

NOTE: developers never istantiate a MMOItem manually: this is done by the SmartFoxServer 2X API internally.

Parameters
id:int — The item id.
Method Detail
containsVariable()method
public function containsVariable(name:String):Boolean

Indicates whether this item has the specified MMOItem Variable set or not.

Parameters

name:String — The name of the MMOItem Variable whose existance must be checked.

Returns
Booleantrue if an MMOItem Variable with the passed name is set for this item.
getVariable()method 
public function getVariable(name:String):IMMOItemVariable

Retrieves an MMOItem Variable from its name.

Parameters

name:String — The name of the MMOItem Variable to be retrieved.

Returns
IMMOItemVariable — The MMOItemVariable object, or null if no MMOItem Variable with the passed name is associated to this item.
getVariables()method 
public function getVariables():Array

Retrieves all the MMOItem Variables of this item.

Returns
Array — The list of MMOItemVariable objects associated to this item.
setVariable()method 
public function setVariable(itemVariable:IMMOItemVariable):void

Parameters

itemVariable:IMMOItemVariable

setVariables()method 
public function setVariables(itemVariables:Array):void

Parameters

itemVariables:Array

toString()method 
public function toString():String

Returns a string that contains the item id.

Returns
String — The string representation of the MMOItem object.