Class ReplicatedValue
Defined in File ReplicatedValue.h
Nested Relationships
Nested Types
Class Documentation
-
class ReplicatedValue
ReplicatedValue is an intermediate class that enables clients to pack data into types that are supported by Connected Spaces Platform replication systems.
Public Functions
-
ReplicatedValue()
A default ReplicatedValue will not have a valid type (“ReplicatedValueType::InvalidType”), and will have no internal value associated.
Do not use this constructor unless you know what you are doing!
-
ReplicatedValue(bool InBoolValue)
Construct a ReplicatedValue based on a bool type.
- Parameters
InBoolValue – bool : Initial value.
-
ReplicatedValue(float InFloatValue)
Construct a ReplicatedValue based on a float type.
- Parameters
InFloatValue – float : Initial value.
-
ReplicatedValue(int64_t InLongValue)
Construct a ReplicatedValue based on a Long (uint64_t) type.
- Parameters
InLongValue – int64_t : Initial value.
-
ReplicatedValue(const char *InStringValue)
Construct a ReplicatedValue based on a csp::common::String type derived from the given char*.
- Parameters
InLongValue – int64_t : Initial value.
-
ReplicatedValue(const csp::common::String &InStringValue)
Construct a ReplicatedValue based on an csp::common::String type.
- Parameters
InStringValue – csp::common::String : Initial value.
-
ReplicatedValue(const csp::common::Vector2 &InVector2Value)
Construct a ReplicatedValue based on a csp::common::Vector2 type.
- Parameters
InVector2Value – csp::common::Vector2 : Initial value.
-
ReplicatedValue(const csp::common::Vector3 &InVector3Value)
Construct a ReplicatedValue based on a csp::common::Vector3 type.
- Parameters
InVector3Value – csp::common::Vector3 : Initial value.
-
ReplicatedValue(const csp::common::Vector4 &InVector4Value)
Construct a ReplicatedValue based on an csp::common::Vector4 type.
- Parameters
InVector4Value – csp::common::Vector4 : Initial value.
-
ReplicatedValue(const csp::common::Map<csp::common::String, ReplicatedValue> &InMapValue)
Construct a ReplicatedValue based on an csp::common::Map type with a string value as the key.
- Parameters
InMapValue – csp::common::Map : Initial value.
-
ReplicatedValue(const ReplicatedValue &Other)
Copy constructor.
- Parameters
Other – csp::multiplayer::ReplicatedValue& : The value to copy.
-
~ReplicatedValue()
Destroys the replicated value instance.
-
ReplicatedValue &operator=(const ReplicatedValue &InValue)
Assignment operator overload.
- Parameters
InValue – ReplicatedValue : Other replicated value to set this one to.
-
bool operator==(const ReplicatedValue &OtherValue) const
Equality operator overload.
- Parameters
ReplicatedValue – : Other value to compare to.
-
bool operator!=(const ReplicatedValue &OtherValue) const
Non equality operator overload.
- Parameters
ReplicatedValue – : Other value to compare to.
-
bool operator<(const ReplicatedValue &OtherValue) const
Less than operator overload.
- Parameters
ReplicatedValue – : Other value to compare to.
-
bool operator>(const ReplicatedValue &OtherValue) const
Greater than operator overload.
- Parameters
ReplicatedValue – : Other value to compare to.
-
inline ReplicatedValueType GetReplicatedValueType() const
Gets the type of replicated value.
- Returns
ReplicatedValueType: Enum representing all supported replication base types.
-
void SetBool(bool InValue)
Sets a bool value for this replicated value, will overwrite any previous value.
- Parameters
InValue –
-
bool GetBool() const
Get a bool value from this replicated value, will assert if not a bool type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
bool
-
void SetFloat(float InValue)
Sets a float value for this replicated value, will overwrite any previous value.
- Parameters
InValue –
-
float GetFloat() const
Get a float value from this replicated value, will assert if not a float type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
float value
-
void SetInt(int64_t InValue)
Sets a int64 value for this replicated value, will overwrite any previous value.
- Parameters
InValue –
-
int64_t GetInt() const
Get a int64 value from this replicated value, will assert if not a int64 type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
int64 value
-
void SetString(const char *InValue)
Set a string value for this replicated value from a const char*, will overwrite and previous value.
-
void SetString(const csp::common::String &InValue)
Set a string value for this replicated value from a csp::common::String&, will overwrite and previous value.
-
const csp::common::String &GetString() const
Get a csp::common::String& value from this replicated value, will assert if not a csp::common::String type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
-
void SetVector2(const csp::common::Vector2 &InValue)
Set a Vector2 value for this replicated value from a csp::common::Vector2, will overwrite and previous value.
-
const csp::common::Vector2 &GetVector2() const
Get a csp::common::Vector2 value from this replicated value, will assert if not a csp::common::Vector2 type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
-
void SetVector3(const csp::common::Vector3 &InValue)
Set a Vector3 value for this replicated value from a csp::common::Vector3, will overwrite and previous value.
-
const csp::common::Vector3 &GetVector3() const
Get a csp::common::Vector3 value from this replicated value, will assert if not a csp::common::Vector3 type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
-
void SetVector4(const csp::common::Vector4 &InValue)
Set a Vector4 value for this replicated value from a csp::common::Vector4, will overwrite and previous value.
-
const csp::common::Vector4 &GetVector4() const
Get a csp::common::Vector4 value from this replicated value, will assert if not a csp::common::Vector4 type.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
-
const csp::common::Map<csp::common::String, ReplicatedValue> &GetStringMap() const
Get a csp::common::Map value with a string value as the key.
This will assert if not a csp::common::Map type with a string value as the key.
Use ReplicatedValue::GetReplicatedValueType to ensure type before accessing.
- Returns
-
void SetStringMap(const csp::common::Map<csp::common::String, ReplicatedValue> &InValue)
Set a string Map value for this replicated value from a csp::common::Map, will overwrite any previous value.
Public Static Functions
-
static const csp::common::String &GetDefaultString()
Get a generic default string.
- Returns
The default string.
-
static const csp::common::Vector2 &GetDefaultVector2()
Get a generic default Vector2.
- Returns
The default Vector2.
-
static const csp::common::Vector3 &GetDefaultVector3()
Get a generic default Vector3.
- Returns
The default Vector3.
-
static const csp::common::Vector4 &GetDefaultVector4()
Get a generic default Vector4.
- Returns
The default Vector4.
-
static const csp::common::Map<csp::common::String, ReplicatedValue> &GetDefaultStringMap()
Get a generic default StringMap.
- Returns
The default StringMap.
-
static size_t GetSizeOfInternalValue()
returns the size of the stored internal value.
- Returns
size_t size of the internal value.
-
ReplicatedValue()