Skip to content

AAndromedaWorkstation

Kind: class Source: Source/Andromeda/Workstation/AndromedaWorkstation.h Base classes: AActor, IAndromedaFocusCandidateProviderInterface

Details

Abstract base actor for workstation placement, screen prompt, and placed-object usage behavior.

Public Properties

Member Type Summary
RootSceneComponent TObjectPtr< USceneComponent > Root scene component for the workstation actor.
MeshComponent TObjectPtr< UStaticMeshComponent > Visible workstation mesh and visibility trace blocker.
PlacementValidatorComponent TObjectPtr< UAndromedaWorkstationPlacementValidatorComponent > Component that discovers placement query volumes and reports correctly placed objects.
DefaultPlacementVolumeComponent TObjectPtr< UBoxComponent > Default placement query volume tagged for the placement validator.
ScreenComponent TObjectPtr< UAndromedaWorkstationScreenComponent > World-space widget surface that implements prompt and interaction interfaces.
CapabilityEventsComponent TObjectPtr< UAndromedaCapabilityEventsComponent > Shared event source for screen prompt and interaction refresh.

Protected Properties

Member Type Summary
EmptyPromptText FText Workstation-specific empty prompt text.
UseWorkstationPromptText FText Workstation-specific use prompt text.

Public Methods

Member Type Summary
AAndromedaWorkstation function Creates mesh, placement validator, default volume, screen, and capability event components.
GetOwningStation AAndromedaStation * Returns the station this workstation belongs to.
GetStationDatabankComponent UAndromedaStationDatabankComponent * Returns the owning station databank, if any.
GetCapabilityEventsComponent UAndromedaCapabilityEventsComponent * Returns the screen prompt and interaction event source.
CanInteractWithScreen bool Reports whether the screen can be interacted with.
GetScreenPrompt FText Returns use prompt text when screen interaction is available.
InteractWithScreen void Uses the current placed object and notifies prompt state.
CanAcceptObjectAtTransform bool Validates object type and spatial placement at a proposed transform.
GetFocusCandidate_Implementation UObject * Routes screen component hits to the screen focus candidate.

Protected Methods

Member Type Summary
CanAcceptObject bool Base object eligibility check for placement acceptance.
CanUsePlacedObject bool Base object eligibility check for screen use.
TryUsePlacedObject bool Extension point executed by screen interaction.
FindSingleCorrectlyPlacedAcceptableObject UObject * Returns a single acceptable placed object, or null unless the count is exactly one.
FindSingleUsablePlacedObject UObject * Returns a single acceptable object that can currently be used with the workstation.
GetCorrectlyPlacedAcceptableObjects TArray< UObject * > Collects unique correctly placed objects accepted by this workstation.
SubscribeToPlacementEvents void Subscribes to placement-domain commit events.
UnsubscribeFromPlacementEvents void Unsubscribes from placement-domain commit events.
HandlePlacementCommitted void Handles placement commits that can change this workstation's spatially discovered state.
OnConstruction void Configures placement query volumes in editor construction.
PostInitializeComponents void Configures placement query volumes at runtime initialization.
BeginPlay void Subscribes to world placement events.
EndPlay void Unsubscribes from world placement events.

Members

RootSceneComponent

TObjectPtr< USceneComponent > RootSceneComponent

Root scene component for the workstation actor.

MeshComponent

TObjectPtr< UStaticMeshComponent > MeshComponent

Visible workstation mesh and visibility trace blocker.

PlacementValidatorComponent

TObjectPtr< UAndromedaWorkstationPlacementValidatorComponent > PlacementValidatorComponent

Component that discovers placement query volumes and reports correctly placed objects.

DefaultPlacementVolumeComponent

TObjectPtr< UBoxComponent > DefaultPlacementVolumeComponent

Default placement query volume tagged for the placement validator.

ScreenComponent

TObjectPtr< UAndromedaWorkstationScreenComponent > ScreenComponent

World-space widget surface that implements prompt and interaction interfaces.

CapabilityEventsComponent

TObjectPtr< UAndromedaCapabilityEventsComponent > CapabilityEventsComponent

Shared event source for screen prompt and interaction refresh.

EmptyPromptText

FText EmptyPromptText

Workstation-specific empty prompt text.

UseWorkstationPromptText

FText UseWorkstationPromptText

Workstation-specific use prompt text.

AAndromedaWorkstation

AAndromedaWorkstation::AAndromedaWorkstation()

Creates mesh, placement validator, default volume, screen, and capability event components.

GetOwningStation

AAndromedaStation * AAndromedaWorkstation::GetOwningStation() const

Returns the station this workstation belongs to.

Returns:

Station whose access volume contains this workstation, or nullptr when none is found.

GetStationDatabankComponent

UAndromedaStationDatabankComponent * AAndromedaWorkstation::GetStationDatabankComponent() const

Returns the owning station databank, if any.

Returns:

Spatially resolved station's databank component, or nullptr when no owning station exists.

GetCapabilityEventsComponent

UAndromedaCapabilityEventsComponent * AAndromedaWorkstation::GetCapabilityEventsComponent() const

Returns the screen prompt and interaction event source.

Returns:

CapabilityEventsComponent used by workstation screen prompt and interaction subscribers.

CanInteractWithScreen

bool AAndromedaWorkstation::CanInteractWithScreen() const

Reports whether the screen can be interacted with. This is only possible when exactly one usable placed object is available.

Returns:

True when FindSingleUsablePlacedObject returns one object.

GetScreenPrompt

FText AAndromedaWorkstation::GetScreenPrompt() const

Returns use prompt text when screen interaction is available.

Returns:

UseWorkstationPromptText when interaction is available, otherwise empty text.

InteractWithScreen

void AAndromedaWorkstation::InteractWithScreen()

Uses the current placed object and notifies prompt state.

Finds the single correctly placed acceptable object, tries to use it, then broadcasts an capability change when prompts and interaction state may need to refresh.

CanAcceptObjectAtTransform

bool AAndromedaWorkstation::CanAcceptObjectAtTransform(UObject *CandidateObject, const FTransform &CandidateTransform) const

Validates object type and spatial placement at a proposed transform.

Combines subclass acceptance rules with placement-validator geometry checks so placement mode can warn before committing.

Parameters:

Name Type Description
CandidateObject UObject * Object to test.
CandidateTransform const FTransform & Proposed world transform.

Returns:

True when this workstation can accept the object at the transform.

GetFocusCandidate_Implementation

UObject * AAndromedaWorkstation::GetFocusCandidate_Implementation(APawn *ViewingPawn, const FHitResult &Hit) const override

Routes screen component hits to the screen focus candidate.

Mesh, placement volume, anti-volume, and other workstation component hits return nullptr.

Parameters:

Name Type Description
ViewingPawn APawn * Pawn whose camera trace produced Hit.
Hit const FHitResult & Trace result to inspect.

Returns:

ScreenComponent when Hit targets the screen; otherwise nullptr.

CanAcceptObject

bool AAndromedaWorkstation::CanAcceptObject(UObject *CandidateObject) const

Base object eligibility check for placement acceptance.

Subclasses override this to restrict accepted object types.

Parameters:

Name Type Description
CandidateObject UObject * Object to test.

Returns:

True when the object is non-null by default.

CanUsePlacedObject

bool AAndromedaWorkstation::CanUsePlacedObject(UObject *CandidateObject) const

Base object eligibility check for screen use.

Parameters:

Name Type Description
CandidateObject UObject * Object to test.

Returns:

True when the object is non-null by default.

TryUsePlacedObject

bool AAndromedaWorkstation::TryUsePlacedObject(UObject *Object)

Extension point executed by screen interaction.

Base implementation checks CanUsePlacedObject. Subclasses perform scanner or packager work.

Parameters:

Name Type Description
Object UObject * Single usable placed object.

Returns:

True when the object was used.

FindSingleCorrectlyPlacedAcceptableObject

UObject * AAndromedaWorkstation::FindSingleCorrectlyPlacedAcceptableObject() const

Returns a single acceptable placed object, or null unless the count is exactly one. This is different from FindSingleUsablePlacedObject as it only considers objects that are correctly placed on the workstation without checking if the workstation can work on them.

Ambiguous placement intentionally disables workstation use.

Returns:

One acceptable object, or nullptr when there are zero or multiple.

FindSingleUsablePlacedObject

UObject * AAndromedaWorkstation::FindSingleUsablePlacedObject() const

Returns a single acceptable object that can currently be used with the workstation. This is different from FindSingleCorrectlyPlacedAcceptableObject as it considers the workstation's state and capabilities and whether the workstation can actually work on the object

Returns:

One usable object, or nullptr when placement is ambiguous or CanUsePlacedObject fails.

GetCorrectlyPlacedAcceptableObjects

TArray< UObject * > AAndromedaWorkstation::GetCorrectlyPlacedAcceptableObjects() const

Collects unique correctly placed objects accepted by this workstation.

Returns:

Accepted objects after null, duplicate, and subclass filters.

SubscribeToPlacementEvents

void AAndromedaWorkstation::SubscribeToPlacementEvents()

Subscribes to placement-domain commit events.

UnsubscribeFromPlacementEvents

void AAndromedaWorkstation::UnsubscribeFromPlacementEvents()

Unsubscribes from placement-domain commit events.

HandlePlacementCommitted

void AAndromedaWorkstation::HandlePlacementCommitted(AActor *PlacedActor, const FTransform &PlacedTransform)

Handles placement commits that can change this workstation's spatially discovered state.

Parameters:

Name Type Description
PlacedActor AActor *
PlacedTransform const FTransform &

OnConstruction

void AAndromedaWorkstation::OnConstruction(const FTransform &Transform) override

Configures placement query volumes in editor construction.

Parameters:

Name Type Description
Transform const FTransform &

PostInitializeComponents

void AAndromedaWorkstation::PostInitializeComponents() override

Configures placement query volumes at runtime initialization.

BeginPlay

void AAndromedaWorkstation::BeginPlay() override

Subscribes to world placement events.

EndPlay

void AAndromedaWorkstation::EndPlay(const EEndPlayReason::Type EndPlayReason) override

Unsubscribes from world placement events.

Parameters:

Name Type Description
EndPlayReason const EEndPlayReason::Type