summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Thronefall_1_57/Decompile/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs')
-rw-r--r--Thronefall_1_57/Decompile/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs
new file mode 100644
index 0000000..60ea49c
--- /dev/null
+++ b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/StaticCombinedObjectMatcher.cs
@@ -0,0 +1,39 @@
+namespace NGS.MeshFusionPro;
+
+public class StaticCombinedObjectMatcher : CombinedObjectMatcher<CombinedObject, CombineSource>
+{
+ private RendererSettings _settings;
+
+ private int _vertexCount;
+
+ private int _vertexLimit;
+
+ public StaticCombinedObjectMatcher(int vertexLimit)
+ {
+ _vertexLimit = vertexLimit;
+ }
+
+ public override void StartMatching(CombinedObject combinedObject)
+ {
+ _settings = combinedObject.RendererSettings;
+ _vertexCount = combinedObject.VertexCount;
+ }
+
+ public override bool CanAddSource(CombineSource source)
+ {
+ if (!_settings.Equals(source.RendererSettings))
+ {
+ return false;
+ }
+ if (_vertexCount + source.CombineInfo.vertexCount > _vertexLimit)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public override void SourceAdded(CombineSource source)
+ {
+ _vertexCount += source.CombineInfo.vertexCount;
+ }
+}