Skip to content

Commit b82d296

Browse files
Code cleanup and refactoring
1 parent 179980a commit b82d296

147 files changed

Lines changed: 4074 additions & 1977 deletions

File tree

Some content is hidden

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

CHANGELOG.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RELEASELOG.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Core/Collections/AppaList_RenderingStateReasonCode.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ public AppaList_RenderingStateReasonCode()
1515
{
1616
}
1717

18-
public AppaList_RenderingStateReasonCode(int capacity, float capacityIncreaseMultiplier = 2, bool noTracking = false) : base(
19-
capacity,
20-
capacityIncreaseMultiplier,
21-
noTracking
22-
)
18+
public AppaList_RenderingStateReasonCode(
19+
int capacity,
20+
float capacityIncreaseMultiplier = 2,
21+
bool noTracking = false) : base(capacity, capacityIncreaseMultiplier, noTracking)
2322
{
2423
}
2524

26-
public AppaList_RenderingStateReasonCode(AppaList<RenderingStateReasonCode> list) : base(list)
25+
public AppaList_RenderingStateReasonCode(AppaList<RenderingStateReasonCode> list) : base(
26+
list
27+
)
2728
{
2829
}
2930

src/Core/Collections/RenderingStateReasonCodeLookup.cs

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,59 @@
1010

1111
namespace Appalachia.Prefabs.Core.Collections
1212
{
13-
public class RenderingStateReasonCodeLookup : AppaLookup<RenderingStateReasonCode, string, AppaList_RenderingStateReasonCode,
14-
AppaList_string>
13+
public class RenderingStateReasonCodeLookup : AppaLookup<RenderingStateReasonCode, string,
14+
AppaList_RenderingStateReasonCode, AppaList_string>
1515
{
1616
protected override bool NoTracking => true;
1717

1818
public void InitializeLookup()
1919
{
20-
AddOrUpdate(RenderingStateReasonCode.NONE, "");
21-
AddOrUpdate(RenderingStateReasonCode.PREFAB_RENDER_SET_NULL, "Prefab Rendering Sets Collection Is Not Set");
22-
AddOrUpdate(RenderingStateReasonCode.PREFAB_RENDER_SET_EMPTY, "Prefab Rendering Sets Collection Is Empty");
23-
AddOrUpdate(RenderingStateReasonCode.DISTANCE_REFERENCE_NULL, "Distance Reference Point Is Not Set");
24-
AddOrUpdate(RenderingStateReasonCode.GPUI_PREFAB_MANAGER_NULL, "GPUI Prefab Manager Is Not Set");
25-
AddOrUpdate(RenderingStateReasonCode.GPUI_SIMULATOR_NULL, "GPUI Editor Simulator Is Not Created");
26-
AddOrUpdate(RenderingStateReasonCode.STATE_INVALID, "Pending State Was Invalid");
27-
AddOrUpdate(RenderingStateReasonCode.NOT_ENABLED, "Prefab Rendering Manager Is Not Enabled");
28-
AddOrUpdate(RenderingStateReasonCode.NOT_ACTIVE_SELF, "Prefab Rendering Manager Is Not Active (Game Object)");
29-
AddOrUpdate(RenderingStateReasonCode.NOT_ACTIVE_HIERARCHY, "Prefab Rendering Manager Is Not Active In Hierarchy(Game Object)");
30-
AddOrUpdate(RenderingStateReasonCode.NOT_SIMULATING, "Editor Simulation Is Not Started");
31-
AddOrUpdate(RenderingStateReasonCode.PREVENT_OPTIONS, "Execution Options Prohibit Rendering");
32-
AddOrUpdate(RenderingStateReasonCode.PREVENT_ERROR, "Execution Was Stopped Due To Errors");
20+
AddOrUpdate(RenderingStateReasonCode.NONE, "");
21+
AddOrUpdate(
22+
RenderingStateReasonCode.PREFAB_RENDER_SET_NULL,
23+
"Prefab Rendering Sets Collection Is Not Set"
24+
);
25+
AddOrUpdate(
26+
RenderingStateReasonCode.PREFAB_RENDER_SET_EMPTY,
27+
"Prefab Rendering Sets Collection Is Empty"
28+
);
29+
AddOrUpdate(
30+
RenderingStateReasonCode.DISTANCE_REFERENCE_NULL,
31+
"Distance Reference Point Is Not Set"
32+
);
33+
AddOrUpdate(
34+
RenderingStateReasonCode.GPUI_PREFAB_MANAGER_NULL,
35+
"GPUI Prefab Manager Is Not Set"
36+
);
37+
AddOrUpdate(
38+
RenderingStateReasonCode.GPUI_SIMULATOR_NULL,
39+
"GPUI Editor Simulator Is Not Created"
40+
);
41+
AddOrUpdate(RenderingStateReasonCode.STATE_INVALID, "Pending State Was Invalid");
42+
AddOrUpdate(
43+
RenderingStateReasonCode.NOT_ENABLED,
44+
"Prefab Rendering Manager Is Not Enabled"
45+
);
46+
AddOrUpdate(
47+
RenderingStateReasonCode.NOT_ACTIVE_SELF,
48+
"Prefab Rendering Manager Is Not Active (Game Object)"
49+
);
50+
AddOrUpdate(
51+
RenderingStateReasonCode.NOT_ACTIVE_HIERARCHY,
52+
"Prefab Rendering Manager Is Not Active In Hierarchy(Game Object)"
53+
);
54+
AddOrUpdate(
55+
RenderingStateReasonCode.NOT_SIMULATING,
56+
"Editor Simulation Is Not Started"
57+
);
58+
AddOrUpdate(
59+
RenderingStateReasonCode.PREVENT_OPTIONS,
60+
"Execution Options Prohibit Rendering"
61+
);
62+
AddOrUpdate(
63+
RenderingStateReasonCode.PREVENT_ERROR,
64+
"Execution Was Stopped Due To Errors"
65+
);
3366
}
3467

3568
protected override string GetDisplayTitle(RenderingStateReasonCode key, string value)

src/Core/PrefabContentType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public enum PrefabContentType : short
2727

2828
Tree = 600,
2929
Leaves = 610,
30-
30+
3131
Roots = 700,
32-
32+
3333
Hillside = 800,
3434
Ridge = 810,
3535
Cliff = 820

src/Core/PrefabContentType_OVERRIDE.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@
77

88
namespace Appalachia.Prefabs.Core
99
{
10-
[Serializable]
11-
public class PrefabContentType_OVERRIDE : Overridable<PrefabContentType, PrefabContentType_OVERRIDE>
10+
[Serializable]
11+
public class
12+
PrefabContentType_OVERRIDE : Overridable<PrefabContentType, PrefabContentType_OVERRIDE>
1213
{
13-
public PrefabContentType_OVERRIDE(bool overrideEnabled, PrefabContentType value) : base(overrideEnabled, value)
14+
public PrefabContentType_OVERRIDE(bool overrideEnabled, PrefabContentType value) : base(
15+
overrideEnabled,
16+
value
17+
)
1418
{
1519
}
1620

17-
public PrefabContentType_OVERRIDE(Overridable<PrefabContentType, PrefabContentType_OVERRIDE> value) : base(value)
21+
public PrefabContentType_OVERRIDE(
22+
Overridable<PrefabContentType, PrefabContentType_OVERRIDE> value) : base(value)
1823
{
1924
}
2025

src/Core/PrefabModelType_OVERRIDE.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77

88
namespace Appalachia.Prefabs.Core
99
{
10-
[Serializable]
11-
public class PrefabModelType_OVERRIDE : Overridable<PrefabModelType, PrefabModelType_OVERRIDE>
10+
[Serializable]
11+
public class PrefabModelType_OVERRIDE : Overridable<PrefabModelType, PrefabModelType_OVERRIDE>
1212
{
13-
public PrefabModelType_OVERRIDE(bool overrideEnabled, PrefabModelType value) : base(overrideEnabled, value)
13+
public PrefabModelType_OVERRIDE(bool overrideEnabled, PrefabModelType value) : base(
14+
overrideEnabled,
15+
value
16+
)
1417
{
1518
}
1619

17-
public PrefabModelType_OVERRIDE(Overridable<PrefabModelType, PrefabModelType_OVERRIDE> value) : base(value)
20+
public PrefabModelType_OVERRIDE(
21+
Overridable<PrefabModelType, PrefabModelType_OVERRIDE> value) : base(value)
1822
{
1923
}
2024

src/Core/States/InstanceInteractionCounts.cs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88

99
namespace Appalachia.Prefabs.Core.States
1010
{
11-
[BurstCompile, Serializable]
11+
[BurstCompile]
12+
[Serializable]
1213
public struct InstanceInteractionCounts
1314
{
15+
public ushort notSetCount;
16+
public ushort disabledCount;
17+
public ushort enabledCount;
18+
1419
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1520
public InstanceInteractionCounts(InstanceInteractionState state)
1621
{
@@ -19,28 +24,26 @@ public InstanceInteractionCounts(InstanceInteractionState state)
1924
enabledCount = GetEnabledCountFromState(state);
2025
}
2126

22-
public ushort notSetCount;
23-
public ushort disabledCount;
24-
public ushort enabledCount;
25-
2627
public ushort total => (ushort) (notSetCount + disabledCount + enabledCount);
2728

28-
29-
[BurstCompile, MethodImpl(MethodImplOptions.AggressiveInlining)]
29+
[BurstCompile]
30+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3031
public void AddFrom(InstanceInteractionCounts b)
3132
{
3233
notSetCount += b.notSetCount;
3334
disabledCount += b.disabledCount;
3435
enabledCount += b.enabledCount;
3536
}
3637

37-
[BurstDiscard, MethodImpl(MethodImplOptions.AggressiveInlining)]
38+
[BurstDiscard]
39+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3840
public override string ToString()
3941
{
4042
return $"Interact {enabledCount} / {total}";
4143
}
42-
43-
[BurstCompile, MethodImpl(MethodImplOptions.AggressiveInlining)]
44+
45+
[BurstCompile]
46+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
4447
public static ushort GetNotSetCountFromState(InstanceInteractionState state)
4548
{
4649
return state switch
@@ -51,8 +54,9 @@ public static ushort GetNotSetCountFromState(InstanceInteractionState state)
5154
_ => throw new ArgumentOutOfRangeException(nameof(state), state, null)
5255
};
5356
}
54-
55-
[BurstCompile, MethodImpl(MethodImplOptions.AggressiveInlining)]
57+
58+
[BurstCompile]
59+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5660
public static ushort GetDisabledCountFromState(InstanceInteractionState state)
5761
{
5862
return state switch
@@ -63,8 +67,9 @@ public static ushort GetDisabledCountFromState(InstanceInteractionState state)
6367
_ => throw new ArgumentOutOfRangeException(nameof(state), state, null)
6468
};
6569
}
66-
67-
[BurstCompile, MethodImpl(MethodImplOptions.AggressiveInlining)]
70+
71+
[BurstCompile]
72+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
6873
public static ushort GetEnabledCountFromState(InstanceInteractionState state)
6974
{
7075
return state switch

src/Core/States/InstancePhysicsCounts.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88

99
namespace Appalachia.Prefabs.Core.States
1010
{
11-
[BurstCompile, Serializable]
11+
[BurstCompile]
12+
[Serializable]
1213
public struct InstancePhysicsCounts
1314
{
15+
public ushort notSetCount;
16+
public ushort disabledCount;
17+
public ushort enabledCount;
18+
1419
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1520
public InstancePhysicsCounts(InstancePhysicsState state)
1621
{
@@ -36,21 +41,19 @@ public InstancePhysicsCounts(InstancePhysicsState state)
3641
}
3742
}
3843

39-
public ushort notSetCount;
40-
public ushort disabledCount;
41-
public ushort enabledCount;
42-
4344
public ushort total => (ushort) (notSetCount + disabledCount + enabledCount);
4445

45-
[BurstCompile, MethodImpl(MethodImplOptions.AggressiveInlining)]
46+
[BurstCompile]
47+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
4648
public void AddFrom(InstancePhysicsCounts b)
4749
{
4850
notSetCount += b.notSetCount;
4951
disabledCount += b.disabledCount;
5052
enabledCount += b.enabledCount;
5153
}
5254

53-
[BurstDiscard, MethodImpl(MethodImplOptions.AggressiveInlining)]
55+
[BurstDiscard]
56+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5457
public override string ToString()
5558
{
5659
return $"Phys {enabledCount} / {total}";

src/Core/States/InstanceRenderingCounts.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88

99
namespace Appalachia.Prefabs.Core.States
1010
{
11-
[BurstCompile, Serializable]
11+
[BurstCompile]
12+
[Serializable]
1213
public struct InstanceRenderingCounts
1314
{
15+
public ushort notSetCount;
16+
public ushort disabledCount;
17+
public ushort meshRenderingCount;
18+
public ushort gpuInstancingCount;
19+
1420
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1521
public InstanceRenderingCounts(InstanceRenderingState state)
1622
{
@@ -45,23 +51,21 @@ public InstanceRenderingCounts(InstanceRenderingState state)
4551
}
4652
}
4753

48-
public ushort notSetCount;
49-
public ushort disabledCount;
50-
public ushort meshRenderingCount;
51-
public ushort gpuInstancingCount;
54+
public ushort total =>
55+
(ushort) (notSetCount + disabledCount + meshRenderingCount + gpuInstancingCount);
5256

53-
public ushort total => (ushort) (notSetCount + disabledCount + meshRenderingCount + gpuInstancingCount);
54-
55-
[BurstCompile, MethodImpl(MethodImplOptions.AggressiveInlining)]
57+
[BurstCompile]
58+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5659
public void AddFrom(InstanceRenderingCounts b)
5760
{
5861
notSetCount += b.notSetCount;
5962
disabledCount += b.disabledCount;
6063
meshRenderingCount += b.meshRenderingCount;
6164
gpuInstancingCount += b.gpuInstancingCount;
6265
}
63-
64-
[BurstDiscard, MethodImpl(MethodImplOptions.AggressiveInlining)]
66+
67+
[BurstDiscard]
68+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
6569
public override string ToString()
6670
{
6771
return $"Render {meshRenderingCount}m + {gpuInstancingCount}i / {total}";

0 commit comments

Comments
 (0)