Class MMOItem

  • All Implemented Interfaces:
    IMMOItem

    public class MMOItem
    extends java.lang.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
    • Constructor Detail

      • MMOItem

        public MMOItem​(int id)
    • Method Detail

      • fromSFSArray

        public static IMMOItem fromSFSArray​(com.smartfoxserver.v2.entities.data.ISFSArray encodedItem)
      • containsVariable

        public boolean containsVariable​(java.lang.String name)
        Indicates whether this MMOItem has the specified Item Variable set or not.
        Specified by:
        containsVariable in interface IMMOItem
        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.
      • setAOIEntryPoint

        public void setAOIEntryPoint​(Vec3D aoiEntryPoint)
      • getId

        public int getId()
        The unique ID of this item
        Specified by:
        getId in interface IMMOItem
      • getVariable

        public IMMOItemVariable getVariable​(java.lang.String name)
        Retrieves a User Variable from its name.
        Specified by:
        getVariable in interface IMMOItem
        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:
        IMMOItem.getVariables(), MMOItemVariable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object