Component that gives a GameObject a network identity (UUID) and dirty flag.
More...
#include <network_identity.h>
Component that gives a GameObject a network identity (UUID) and dirty flag.
Attach this to any GameObject that should be replicated. Systems or user code should call mark_dirty() when the object's networked state changes.
Usage:
◆ NetworkIdentity() [1/2]
| NetworkIdentity::NetworkIdentity |
( |
| ) |
|
◆ NetworkIdentity() [2/2]
| NetworkIdentity::NetworkIdentity |
( |
const std::string & |
uuid | ) |
|
|
explicit |
◆ clear_dirty()
| void NetworkIdentity::clear_dirty |
( |
| ) |
|
|
noexcept |
◆ is_dirty()
| bool NetworkIdentity::is_dirty |
( |
| ) |
const |
|
noexcept |
◆ mark_dirty()
| void NetworkIdentity::mark_dirty |
( |
| ) |
|
|
noexcept |
◆ on_deserialize()
| void NetworkIdentity::on_deserialize |
( |
const std::vector< uint8_t > & |
, |
|
|
size_t & |
|
|
) |
| |
|
overridevirtual |
Deserializes the component's state from a byte array.
- Parameters
-
| data | The byte array containing the serialized state. |
| offset | The current offset in the byte array from which to start reading. This offset will be updated as bytes are read. |
- Returns
- void
Reimplemented from Component.
◆ on_serialize()
| void NetworkIdentity::on_serialize |
( |
std::vector< uint8_t > & |
| ) |
const |
|
overridevirtual |
Serializes the component's state into a byte array.
- Parameters
-
| out | A vector to which the serialized bytes will be appended. |
- Returns
- A vector of bytes representing the serialized state of the component.
Reimplemented from Component.
◆ owner_uuid()
| const std::string & NetworkIdentity::owner_uuid |
( |
| ) |
const |
|
noexcept |
◆ set_owner_uuid()
| void NetworkIdentity::set_owner_uuid |
( |
const std::string & |
owner | ) |
|
|
noexcept |
◆ set_uuid()
| void NetworkIdentity::set_uuid |
( |
const std::string & |
uuid | ) |
|
|
noexcept |
◆ type_name()
| std::string NetworkIdentity::type_name |
( |
| ) |
const |
|
inlineoverridevirtual |
Provides a consistent type name for the component.
- Returns
- A string representing the type name of the component. @CAUTION: All derived components must implement this method to ensure consistent serialization across different compilers and platforms.
Implements Component.
◆ update()
| void NetworkIdentity::update |
( |
float |
| ) |
|
|
inlineoverridevirtual |
◆ uuid()
| const std::string & NetworkIdentity::uuid |
( |
| ) |
const |
|
noexcept |
The documentation for this class was generated from the following file: