SFS2X Objective-C API  1.7.13
iOS / macOS / tvOS
MMOItemVariable Class Reference

#import <MMOItemVariable.h>

Inherits BaseVariable, and <IMMOItemVariable>.

Class Methods

(id< IMMOItemVariable >) + fromSFSArray:
 
(id) + variableWithName:value:type:
 
(id) + variableWithName:value:
 

Additional Inherited Members

- Instance Methods inherited from BaseVariable
(id) - initWithName:value:type:
 
(id) - getValue
 
(BOOL) - getBoolValue
 
(NSInteger) - getIntValue
 
(NSNumber *) - getDoubleValue
 
(NSString *) - getStringValue
 
(id< ISFSObject >) - getSFSObjectValue
 
(id< ISFSArray >) - getSFSArrayValue
 
(BOOL) - isNull
 
(id< ISFSArray >) - toSFSArray
 
- Protected Attributes inherited from BaseVariable
NSString * _name
 
NSString * _type
 
id _value
 
- Properties inherited from BaseVariable
NSString * name
 
NSString * type
 

Detailed Description

The MMOItemVariable object represents a SmartFoxServer MMOItem Variable entity on the client.

It is a custom value attached to an MMOItem object that gets automatically synchronized between client and server on every change, provided that the MMOItem is inside the Area of Interest (AoI) of the current user in the MMORoom.

Changes in the MMOItemVariables are dispatched via the [ISFSEvents onMMOItemVariablesUpdate] event

NOTE: MMOItem Variables behave exactly like User Variables and support the same data types, but they can be created, updated and deleted on the server side only.

See also
SFSUserVariable
MMORoom
MMOItem
[ISFSEvents onMMOItemVariablesUpdate]

Method Documentation

◆ variableWithName:value:

+ (id< IMMOItemVariable >) variableWithName: (NSString *)  name
value: (id)  value 
Parameters
namethe name of the variable
valuethe variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray )

Reimplemented from BaseVariable.

◆ variableWithName:value:type:

+ (id< IMMOItemVariable >) variableWithName: (NSString *)  name
value: (id)  value
type: (NSInteger)  type 
Parameters
namethe name of the variable
valuethe variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray )
type(optional -1) it's usually not necessary to pass this parameter as the variable value is auto-detected

Reimplemented from BaseVariable.