Class PortalSpaceComponent
Defined in File PortalSpaceComponent.h
Inheritance Relationships
Base Types
public csp::multiplayer::ComponentBase(Class ComponentBase)public csp::multiplayer::IEnableableComponent(Class IEnableableComponent)public csp::multiplayer::IPositionComponent(Class IPositionComponent)
Class Documentation
-
class PortalSpaceComponent : public csp::multiplayer::ComponentBase, public csp::multiplayer::IEnableableComponent, public csp::multiplayer::IPositionComponent
Add a portal to your space that can be used to teleport users to another configured Space.
To ensure the connection to the new space is successful, clients should use the following steps:
Store the new space Id by calling PortalSpaceComponent::GetSpaceId()
Exit the current space via the space system.
Enter the new one (also via the space system).
Public Functions
-
PortalSpaceComponent(csp::common::LogSystem *LogSystem, SpaceEntity *Parent)
Constructs the portal space component, and associates it with the specified Parent space entity.
- Parameters
Parent – The Space entity that owns this component.
-
const csp::common::String &GetSpaceId() const
Retrieves the space ID that this portal points to.
Note
When the user uses the portal, it should be able to leave the current space and enter the one identified by this function.
- Returns
The ID of the space the portal component leads the player to.
-
void SetSpaceId(const csp::common::String &Value)
Sets the space ID that this portal points to.
Note
When the user uses the portal, it should be able to leave the current space and enter the one identified by this function.
- Parameters
Value – The ID of the space the portal component leads the player to.
-
float GetRadius() const
Gets the radius of this portal.
- Returns
The radius of this portal.
-
void SetRadius(float Value)
Sets the radius of this portal.
- Parameters
Value – The radius of this portal.
Public Static Functions
-
static const ComponentSchema &GetSchema()
-
static std::unique_ptr<PortalSpaceComponent> TryMake(const ComponentSchema &InSchema, csp::common::LogSystem *LogSystem, SpaceEntity *Parent)
Creates a portal space component using the provided schema if it is compatible with the built-in schema.
See also
- Parameters
InSchema – The schema to use. Must be compatible with the built-in schema.
LogSystem – The log system.
Parent – The space entity that owns this component.
- Returns
A new PortalSpaceComponent if the schema is compatible, nullptr otherwise.