File size: 1,395 Bytes
511a267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "CoreMinimal.h"
#include "UObject/Object.h"
#include "SingularityRoleTypes.h"
#include "SingularitySpacetimeBridge.generated.h"

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSingularityInputReady, const FSingularityRoleInput&, Input);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSingularitySnapshotReady, const FSingularityTeamSnapshot&, Snapshot);

/**
 * Small engine-side seam for the existing SpacetimeDB contract.
 *
 * The production browser client submits bounded x/z/action inputs and receives
 * authoritative team snapshots. An Unreal transport can bind to these events
 * without ever accepting a client pose, checkpoint, or finish time.
 */
UCLASS(BlueprintType)
class SINGULARITY_API USingularitySpacetimeBridge : public UObject
{
    GENERATED_BODY()

public:
    UPROPERTY(BlueprintAssignable)
    FSingularityInputReady OnInputReady;

    UPROPERTY(BlueprintAssignable)
    FSingularitySnapshotReady OnSnapshotReady;

    UFUNCTION(BlueprintCallable, Category = "Singularity|Network")
    void SubmitRoleInput(ESingularityBodyRole Role, float X, float Z, bool bAction, int64 ClientTick);

    UFUNCTION(BlueprintCallable, Category = "Singularity|Network")
    void ApplyTeamSnapshot(const FSingularityTeamSnapshot& Snapshot);

    UFUNCTION(BlueprintPure, Category = "Singularity|Network")
    static FString RoleToWireName(ESingularityBodyRole Role);
};