Skip to content

Commit c18ca4b

Browse files
committed
Updated Copyrights
1 parent 287041c commit c18ca4b

50 files changed

Lines changed: 991 additions & 796 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ BraceWrapping:
4040
AfterControlStatement: Always
4141
BeforeElse: true
4242
BeforeCatch: true
43+
# BeforeLambdaBody: false - Waiting for Clang12
4344
SplitEmptyFunction: false
4445
SplitEmptyRecord: false
4546
SplitEmptyNamespace: false
@@ -58,10 +59,12 @@ ForEachMacros:
5859
- for
5960
IncludeBlocks: Regroup
6061
IncludeCategories:
62+
- Regex: '.*\.generated\.h'
63+
Priority: 100
6164
- Regex: '.*(PCH).*'
6265
Priority: -1
6366
- Regex: '".*"'
64-
Priority: 1
67+
Priority: 2
6568
- Regex: '^<.*\.(h)>'
6669
Priority: 3
6770
- Regex: '^<.*>'

Source/Attributes/Private/AttrCategory.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "AttrCategory.h"
4-
#include "AttributesSettings.h"
4+
55
#include "AttributesModule.h"
6+
#include "AttributesSettings.h"
67

78

8-
const FAttrCategory FAttrCategory::NoCategory{ NO_ATTRCATEGORY_NAME };
9+
const FAttrCategory FAttrCategory::NoCategory{NAME_None};
910

1011
bool FAttrCategory::IsNone() const
1112
{
12-
if (Name == NO_ATTRCATEGORY_NAME)
13+
if (Name.IsNone())
1314
return true;
1415

1516
return !GetDefault<UAttributesSettings>()->GetCategories().Contains(Name);

Source/Attributes/Private/AttrModifier.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "AttrModifier.h"
4+
45
#include "FloatAttr.h"
56

67

7-
FAttrModifier::FAttrModifier(EModifierMask Mode, float Value)
8-
: Guid(FGuid::NewGuid())
8+
FAttrModifier::FAttrModifier(EModifierMask Mode, float Value) : Guid(FGuid::NewGuid())
99
{
1010
switch (Mode)
1111
{
12-
case EModifierMask::Increment:
13-
Increment = Value;
14-
break;
15-
case EModifierMask::LastMultiplier:
16-
LastMultiplier = Value;
17-
break;
18-
case EModifierMask::BaseMultiplier:
19-
BaseMultiplier = Value;
20-
break;
12+
case EModifierMask::Increment:
13+
Increment = Value;
14+
break;
15+
case EModifierMask::LastMultiplier:
16+
LastMultiplier = Value;
17+
break;
18+
case EModifierMask::BaseMultiplier:
19+
BaseMultiplier = Value;
20+
break;
2121
}
2222
}
2323

@@ -26,8 +26,7 @@ FAttrModifier::FAttrModifier(float Increment, float LastValueMultiplier, float B
2626
, Increment(Increment)
2727
, LastMultiplier(LastValueMultiplier)
2828
, BaseMultiplier(BaseValueMultiplier)
29-
{
30-
}
29+
{}
3130

3231
void FAttrModifier::Apply(float& Value, float BaseValue) const
3332
{

Source/Attributes/Private/AttributesModule.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "AttributesModule.h"
4+
45
#include "AttributesSettings.h"
56

7+
68
DEFINE_LOG_CATEGORY(LogAttributes)
79

810
#define LOCTEXT_NAMESPACE "AttributesModule"
@@ -11,16 +13,17 @@ void FAttributesModule::StartupModule()
1113
{
1214
UE_LOG(LogAttributes, Log, TEXT("Attributes: Log Started"));
1315

14-
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
16+
// This code will execute after your module is loaded into memory; the exact timing is specified in the
17+
// .uplugin file per-module
1518

1619
RegisterSettings();
1720
}
1821

1922
void FAttributesModule::ShutdownModule()
2023
{
2124
UE_LOG(LogAttributes, Log, TEXT("Attributes: Log Ended"));
22-
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
23-
// we call this function before unloading the module.
25+
// This function may be called during shutdown to clean up your module. For modules that support dynamic
26+
// reloading, we call this function before unloading the module.
2427

2528
if (UObjectInitialized())
2629
{
@@ -41,8 +44,8 @@ void FAttributesModule::RegisterSettings()
4144
ISettingsContainerPtr SettingsContainer = SettingsModule->GetContainer("Project");
4245

4346
// Register Attributes settings
44-
ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Game", "Attributes",
45-
LOCTEXT("RuntimeAttributesSettingsName", "Attributes"),
47+
ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Game",
48+
"Attributes", LOCTEXT("RuntimeAttributesSettingsName", "Attributes"),
4649
LOCTEXT("RuntimeAttributesDescription", "Attributes configuration"),
4750
GetMutableDefault<UAttributesSettings>());
4851

@@ -74,7 +77,8 @@ bool FAttributesModule::HandleSettingsSaved()
7477
UAttributesSettings* Settings = GetMutableDefault<UAttributesSettings>();
7578
bool ResaveSettings = false;
7679

77-
if (ModifiedSettingsDelegate.IsBound()) {
80+
if (ModifiedSettingsDelegate.IsBound())
81+
{
7882
ModifiedSettingsDelegate.Execute();
7983
}
8084

Source/Attributes/Private/AttributesSettings.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "AttributesSettings.h"
4+
45
#include "AttributesModule.h"
56

67

78
FAttributeReplicationConfig UAttributesSettings::Replication{};
89

910

10-
UAttributesSettings::UAttributesSettings()
11-
: Super()
11+
UAttributesSettings::UAttributesSettings() : Super()
1212
{
1313
Categories.Add(TEXT("Buff"));
1414
Categories.Add(TEXT("Aura"));
@@ -26,5 +26,5 @@ void UAttributesSettings::BeginDestroy()
2626
void UAttributesSettings::OnWorldInitialization(UWorld* World, const UWorld::InitializationValues IVS)
2727
{
2828
// Update replication settings
29-
Replication = { bReplicateBaseValue, bReplicateAttributeModifiers };
29+
Replication = {bReplicateBaseValue, bReplicateAttributeModifiers};
3030
}

Source/Attributes/Private/BaseAttr.cpp

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "BaseAttr.h"
4+
45
#include "AttributesModule.h"
56

67

7-
uint32 FBaseAttr::IdCount{ 0 };
8+
uint32 FBaseAttr::IdCount{0};
89

910

1011
void FBaseAttr::AddModifier(const FAttrModifier& Modifier, const FAttrCategory& Category)
@@ -18,31 +19,30 @@ void FBaseAttr::AddModifier(const FAttrModifier& Modifier, const FAttrCategory&
1819
{
1920
BaseModifiers.Add(Modifier);
2021
}
21-
else if(!Category.IsNone())
22+
else if (!Category.IsNone())
2223
{
2324
int32 Index = CategoryMods.IndexOfByKey(Category);
2425
if (Index == INDEX_NONE)
2526
{
2627
// Add category if non existent
27-
Index = CategoryMods.HeapPush({ Category });
28+
Index = CategoryMods.HeapPush({Category});
2829
}
2930

3031
CategoryMods[Index].Modifiers.Add(Modifier);
3132
}
3233
else
3334
{
34-
UE_LOG(LogAttributes, Warning, TEXT("Attributes: tried to add a modifier to the unexisting category '%s'"), *Category.Name.ToString());
35+
UE_LOG(LogAttributes, Warning,
36+
TEXT("Attributes: tried to add a modifier to the unexisting category '%s'"),
37+
*Category.Name.ToString());
3538
return;
3639
}
3740

38-
InternalRefreshValue({
39-
EAttributeOperation::AddedMod,
40-
Modifier,
41-
Category
42-
});
41+
InternalRefreshValue({EAttributeOperation::AddedMod, Modifier, Category});
4342
}
4443

45-
bool FBaseAttr::RemoveModifier(const FAttrModifier& Modifier, const FAttrCategory& Category, bool bRemoveFromAllCategories)
44+
bool FBaseAttr::RemoveModifier(
45+
const FAttrModifier& Modifier, const FAttrCategory& Category, bool bRemoveFromAllCategories)
4646
{
4747
bool bChanged = false;
4848

@@ -62,7 +62,7 @@ bool FBaseAttr::RemoveModifier(const FAttrModifier& Modifier, const FAttrCategor
6262
// Remove category if empty
6363
CategoryMods.HeapRemoveAt(CatId);
6464

65-
//Reduce Id, because current one doesn't exist anymore
65+
// Reduce Id, because current one doesn't exist anymore
6666
--CatId;
6767
}
6868
}
@@ -89,18 +89,17 @@ bool FBaseAttr::RemoveModifier(const FAttrModifier& Modifier, const FAttrCategor
8989
}
9090
else
9191
{
92-
UE_LOG(LogAttributes, Warning, TEXT("Attributes: Tried to remove with modifier category '%s', but it doesnt exist on the attribute"), *Category.Name.ToString());
92+
UE_LOG(LogAttributes, Warning,
93+
TEXT("Attributes: Tried to remove with modifier category '%s', but it doesnt exist on the "
94+
"attribute"),
95+
*Category.Name.ToString());
9396
return false;
9497
}
9598
}
9699

97100
if (bChanged)
98101
{
99-
InternalRefreshValue({
100-
EAttributeOperation::RemovedMod,
101-
Modifier,
102-
Category
103-
});
102+
InternalRefreshValue({EAttributeOperation::RemovedMod, Modifier, Category});
104103
}
105104
return bChanged;
106105
}
@@ -142,11 +141,7 @@ void FBaseAttr::CleanCategoryModifiers(const FAttrCategory& Category)
142141
BaseModifiers.Empty();
143142

144143
// Notify
145-
InternalRefreshValue({
146-
EAttributeOperation::RemovedCategory,
147-
{},
148-
Category
149-
});
144+
InternalRefreshValue({EAttributeOperation::RemovedCategory, {}, Category});
150145
}
151146
}
152147
else
@@ -158,15 +153,14 @@ void FBaseAttr::CleanCategoryModifiers(const FAttrCategory& Category)
158153
CategoryMods.HeapRemoveAt(Index);
159154

160155
// Notify
161-
InternalRefreshValue({
162-
EAttributeOperation::RemovedCategory,
163-
{},
164-
Category
165-
});
156+
InternalRefreshValue({EAttributeOperation::RemovedCategory, {}, Category});
166157
}
167158
else
168159
{
169-
UE_LOG(LogAttributes, Warning, TEXT("Attributes: Tried to remove all modifiers of category '%s', but it didnt exist on the attribute"), *Category.Name.ToString());
160+
UE_LOG(LogAttributes, Warning,
161+
TEXT("Attributes: Tried to remove all modifiers of category '%s', but it didnt exist on the "
162+
"attribute"),
163+
*Category.Name.ToString());
170164
return;
171165
}
172166
}
@@ -180,10 +174,6 @@ void FBaseAttr::CleanModifiers()
180174
BaseModifiers.Empty();
181175
CategoryMods.Empty();
182176

183-
InternalRefreshValue({
184-
EAttributeOperation::RemovedAllMods,
185-
{},
186-
FAttrCategory::NoCategory
187-
});
177+
InternalRefreshValue({EAttributeOperation::RemovedAllMods, {}, FAttrCategory::NoCategory});
188178
}
189179
}

Source/Attributes/Private/DoubleAttr.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "DoubleAttr.h"
4+
45
#include "AttributesModule.h"
56

67

@@ -11,11 +12,7 @@ void FDoubleAttr::SetBaseValue(double NewValue)
1112
BaseValue = NewValue;
1213

1314
// Notify
14-
InternalRefreshValue({
15-
EAttributeOperation::BaseValueChanged,
16-
{},
17-
FAttrCategory::NoCategory
18-
});
15+
InternalRefreshValue({EAttributeOperation::BaseValueChanged, {}, FAttrCategory::NoCategory});
1916
}
2017
}
2118

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "DoubleAttributesLibrary.h"

Source/Attributes/Private/FloatAttr.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "FloatAttr.h"
4+
45
#include "AttributesModule.h"
56

67

@@ -11,11 +12,7 @@ void FFloatAttr::SetBaseValue(float NewValue)
1112
BaseValue = NewValue;
1213

1314
// Notify
14-
InternalRefreshValue({
15-
EAttributeOperation::BaseValueChanged,
16-
{},
17-
FAttrCategory::NoCategory
18-
});
15+
InternalRefreshValue({EAttributeOperation::BaseValueChanged, {}, FAttrCategory::NoCategory});
1916
}
2017
}
2118

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// Copyright 2015-2020 Piperift. All Rights Reserved.
1+
// Copyright 2015-2023 Piperift. All Rights Reserved.
22

33
#include "FloatAttributesLibrary.h"

0 commit comments

Comments
 (0)