MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / ResolveActorKey

Function ResolveActorKey

Source/URLab/Public/Bridge/OpHelpers.h:40–59  ·  view source on GitHub ↗

Read the target-actor key from the request envelope. Wire * format: `{"target": " ", "target_by": "actor_id" | * "actor_name"}` (default `"actor_id"` when `target_by` is * absent). Returns false + populates OutError if `target` is * missing. */

Source from the content-addressed store, hash-verified

38 * absent). Returns false + populates OutError if `target` is
39 * missing. */
40inline bool ResolveActorKey(const TSharedPtr<FJsonObject>& Req,
41 FString& OutKey, bool& OutByName,
42 FString& OutError)
43{
44 OutKey.Empty();
45 OutByName = false;
46 OutError.Empty();
47
48 FString Target, By;
49 Req->TryGetStringField(TEXT("target"), Target);
50 Req->TryGetStringField(TEXT("target_by"), By);
51 if (Target.IsEmpty())
52 {
53 OutError = TEXT("missing 'target' field");
54 return false;
55 }
56 OutKey = Target;
57 OutByName = By.Equals(TEXT("actor_name"), ESearchCase::IgnoreCase);
58 return true;
59}
60
61/** Read a 3-element float array under Key. Falls back to Default
62 * if missing or wrong size. Returns true if the field was present

Callers 10

HandleSetActorTransformFunction · 0.85
HandleGetActorBoundsFunction · 0.85
HandleDuplicateActorFunction · 0.85
HandleActorHierarchyFunction · 0.85
HandleSelectActorFunction · 0.85
HandleAddQuickConvertFunction · 0.85
HandleRemoveQuickConvertFunction · 0.85
HandleDestroyActorFunction · 0.85
HandleViewportFrameActorFunction · 0.85
HandleViewportTrackActorFunction · 0.85

Calls 1

IsEmptyMethod · 0.80

Tested by

no test coverage detected