SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::entities::SFSRoomVariable Class Reference

The standard implementation of RoomVariable. More...

#include <SFSRoomVariable.h>

Inheritance diagram for sfs3::entities::SFSRoomVariable:
[legend]

Public Member Functions

bool isPrivate () override
 Indicates whether this Room Variable is private or not.
bool isPersistent () override
 Indicates whether this Room Variable is persistent or not.
std::string toString () override
Public Member Functions inherited from sfs3::entities::Variable
std::string name ()
virtual const VarDatavalue ()
 Returns the value of this variable, whatever its type.
virtual std::optional< bool > boolValue ()
virtual std::optional< uint8_t > byteValue ()
virtual std::optional< int16_t > shortValue ()
virtual std::optional< int32_t > intValue ()
virtual std::optional< int64_t > longValue ()
virtual std::optional< float > floatValue ()
virtual std::optional< double > doubleValue ()
virtual std::optional< std::string > stringValue ()
virtual std::shared_ptr< SFSObjectsfsObjectValue ()
virtual std::shared_ptr< SFSArraysfsArrayValue ()
virtual std::optional< SFSVector2vector2Value ()
virtual std::optional< SFSVector3vector3Value ()
virtual void setNull ()
 Clears the value of this variable.
virtual void setValue (VarData value)
 Sets the value of this variable.
virtual bool isNull ()

Detailed Description

The standard implementation of RoomVariable.

See also
RoomVariable
requests::SetRoomVariablesRequest

Member Function Documentation

◆ isPrivate()

bool sfs3::entities::SFSRoomVariable::isPrivate ( )
overridevirtual

Indicates whether this Room Variable is private or not.

A private Room Variable can be modified by its owner only (the user that created it).

NOTE: setting this flag by hand on a Room Variable returned by the API has no effect on the server and can disrupt the working of the API. You can set it only on a Room Variable you create yourself.

Returns
true if this Room Variable is private

Implements sfs3::entities::RoomVariable.

◆ isPersistent()

bool sfs3::entities::SFSRoomVariable::isPersistent ( )
overridevirtual

Indicates whether this Room Variable is persistent or not.

A persistent Room Variable continues to exist in the Room after the user who created it has left it and until he disconnects.

NOTE: setting this flag by hand on a Room Variable returned by the API has no effect on the server and can disrupt the working of the API. You can set it only on a Room Variable you create yourself.

Returns
true if this Room Variable is persistent

Implements sfs3::entities::RoomVariable.

◆ toString()

std::string sfs3::entities::SFSRoomVariable::toString ( )
overridevirtual
Returns
the name, the type and the value of this variable as text, for logging and debugging

Reimplemented from sfs3::entities::Variable.


The documentation for this class was generated from the following files:
  • entities/SFSRoomVariable.h
  • entities/SFSRoomVariable.cpp