Package | com.smartfoxserver.v2.entities |
Class | public class MMOItem |
Inheritance | MMOItem Object |
Implements | IMMOItem |
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
Property | Defined 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 |
Method | Defined 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 | ||
getVariable(name:String):IMMOItemVariable
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 |
aoiEntryPoint | property |
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.
public function get aoiEntryPoint():Vec3D
public function set aoiEntryPoint(value:Vec3D):void
id | property |
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.
public function get id():int
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.
Parametersid:int — The item id.
|
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.
|
Boolean — true 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.
|
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.
ReturnsArray — 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.
ReturnsString — The string representation of the MMOItem object.
|