Apparatus Version 1.0.0
ECS-like data-driven workflow for Unreal Engine.
Detail.h
1 /*
2  * ░▒▓ APPARATUS ▓▒░
3  *
4  * File: Detail.cpp
5  * Created: Friday, 23rd October 2020 7:00:48 pm
6  * Author: Vladislav Dmitrievich Turbanov (vladislav@turbanov.ru)
7  * ───────────────────────────────────────────────────────────────────
8  * Last Modified: Tuesday, 6th April 2021 1:34:28 pm
9  * Modified By: Vladislav Dmitrievich Turbanov (vladislav@turbanov.ru)
10  * ───────────────────────────────────────────────────────────────────
11  *
12  * The Apparatus source code is for your internal usage only.
13  * Redistribution of this file is strictly prohibited.
14  *
15  * Community forums: https://talk.turbanov.ru
16  *
17  * Copyright 2020 - 2021, SP Vladislav Dmitrievich Turbanov
18  * Made in Russia, Moscow City, Chekhov City
19  */
20 
21 #pragma once
22 
23 #include "CoreMinimal.h"
24 #include "UObject/NoExportTypes.h"
25 #include "UObject/UnrealType.h"
26 
27 #include "Detail.generated.h"
28 
32 UCLASS(Blueprintable, EditInlineNew, Abstract, CollapseCategories,
33  CustomConstructor)
34 class APPARATUSRUNTIME_API UDetail : public UObject
35 {
36  GENERATED_BODY()
37 
38 
41  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Detail,
42  BlueprintGetter = IsEnabled, BlueprintSetter = SetEnabled,
43  Meta = (AllowPrivateAccess = "true"))
44  uint32 bEnabled : 1;
45 
46  friend class ISubjective;
47  friend class UMechanism;
48 
49  public:
50  UDetail();
51 
55  UFUNCTION(BlueprintGetter)
56  FORCEINLINE bool IsEnabled() const { return bEnabled; }
57 
61  UFUNCTION(BlueprintSetter)
62  void SetEnabled(const bool bState = true);
63 
67  UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Apparatus|Detail",
68  Meta = (Keywords = "subjective"))
69  TScriptInterface<class ISubjective> GetOwner() const;
70 
74  UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Apparatus|Detail",
75  Meta = (Keywords = "type kind"))
76  FORCEINLINE TSubclassOf<UDetail> GetClass() const
77  {
78  return UObject::GetClass();
79  }
80 
81  protected:
86  UFUNCTION(BlueprintImplementableEvent, Category = "Apparatus",
87  Meta = (DisplayName = "Activated"))
88  void ReceiveActivated();
89 
94  UFUNCTION(BlueprintImplementableEvent, Category = "Apparatus",
95  Meta = (DisplayName = "Deactivated"))
96  void ReceiveDeactivated();
97 
105  FORCEINLINE virtual void Activated() { ReceiveActivated(); };
106 
114  FORCEINLINE virtual void Deactivated() { ReceiveDeactivated(); };
115 }; // class UDetail
116 
117 FORCEINLINE uint32 GetTypeHash(const TSubclassOf<UDetail> DetailType)
118 {
119  return GetTypeHash(*DetailType);
120 }
An interface for all sorts of subjects.
Definition: Subjective.h:42
The base subject detail (component) class.
Definition: Detail.h:35
virtual void Deactivated()
The event is fired, when the detail has become inactive for a subject.
Definition: Detail.h:114
The main Mechanism function library.
Definition: Mechanism.h:63