|
10 | 10 | class UKeyType; |
11 | 11 | class AActor; |
12 | 12 | class UKeyringComponent; |
| 13 | + |
13 | 14 | /** |
14 | | - * |
| 15 | + * A library with useful functions to work with KeyringComponent. |
15 | 16 | */ |
16 | 17 | UCLASS() |
17 | 18 | class TRICKYKEYRINGSYSTEM_API UKeyringLibrary : public UBlueprintFunctionLibrary |
18 | 19 | { |
19 | 20 | GENERATED_BODY() |
20 | 21 |
|
21 | 22 | public: |
| 23 | + /**Returns KeyringComponent if the given actor has it.*/ |
22 | 24 | UFUNCTION(BlueprintPure, Category="KeyringSystem") |
23 | 25 | static UKeyringComponent* GetKeyringComponent(const AActor* OtherActor); |
24 | 26 |
|
| 27 | + /**Checks if the given actor has key in KeyringComponent.*/ |
25 | 28 | UFUNCTION(BlueprintPure, Category="KeyringSystem") |
26 | 29 | static bool ActorHasKey(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
27 | 30 |
|
| 31 | + /**Adds key to KeyringComponent.*/ |
28 | 32 | UFUNCTION(BlueprintCallable, Category="KeyringSystem") |
29 | 33 | static bool AddKey(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
30 | | - |
| 34 | + |
| 35 | + /**Force the given actor to use the give key class.*/ |
31 | 36 | UFUNCTION(BlueprintCallable, Category="KeyringSystem") |
32 | | - static bool ActorUseKey(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
| 37 | + static bool UseKey(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
33 | 38 |
|
| 39 | + /**Returns a key object from KeyringComponent of the given actor.*/ |
34 | 40 | UFUNCTION(BlueprintPure, Category="KeyringSystem") |
35 | 41 | static UKeyType* GetKeyObject(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
36 | 42 |
|
| 43 | + /**Returns key data from `KeyringComponent` of the given actor.*/ |
37 | 44 | UFUNCTION(BlueprintPure, Category="KeyringSystem") |
38 | 45 | static FKeyData GetKeyData(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
39 | 46 |
|
| 47 | + /**Checks if the given key class is destroyable.*/ |
40 | 48 | UFUNCTION(BlueprintPure, Category="KeyringSystem") |
41 | 49 | static bool IsKeyDestroyable(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
42 | 50 |
|
| 51 | + /**Removes key from KeyringComponent.*/ |
43 | 52 | UFUNCTION(BlueprintPure, Category="KeyringSystem") |
44 | 53 | static bool RemoveKey(const AActor* OtherActor, const TSubclassOf<UKeyType> KeyType); |
45 | | - |
| 54 | + |
| 55 | + /**Removes all keys form `KeyringComponent` of the given actor.*/ |
46 | 56 | UFUNCTION(BlueprintCallable, Category="KeyringSystem") |
47 | 57 | static bool RemoveAllKeys(const AActor* OtherActor); |
48 | 58 | }; |
0 commit comments