Skip to content

Commit edb4a6b

Browse files
committed
feat(CollisionComponent): Collision callback will now have only other entity as parameter
1 parent 0a7d4c1 commit edb4a6b

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
[#] Bug Fixes<br>
88
[.] Others
99

10+
### V 2.6.0 - 04/06/2026
11+
[\~] CollisionComponent: Collision callback will now have only other entity as parameter
12+
1013
### V 2.5.4 - 30/05/2026
1114
[.] Raylib-cs: 8.0.0
1215

SharpEngine.Core/Component/CollisionComponent.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class CollisionComponent(
1919
Vec2 size,
2020
Vec2? offset = null,
2121
bool solid = true,
22-
Action<Entity.Entity, Entity.Entity>? collisionCallback = null,
22+
Action<Entity.Entity>? collisionCallback = null,
2323
bool drawDebug = false
2424
) : Component
2525
{
@@ -45,7 +45,7 @@ public class CollisionComponent(
4545
/// Gets or sets the collision callback action.
4646
/// </summary>
4747
[UsedImplicitly]
48-
public Action<Entity.Entity, Entity.Entity>? CollisionCallback { get; set; } = collisionCallback;
48+
public Action<Entity.Entity>? CollisionCallback { get; set; } = collisionCallback;
4949

5050
/// <summary>
5151
/// Gets or sets a value indicating whether the collision should be drawn for debugging.
@@ -96,8 +96,8 @@ public bool CanGo(Vec2 position)
9696
var selfRect = GetCollisionRect(position);
9797
if (!Raylib.CheckCollisionRecs(entityRect, selfRect)) continue;
9898

99-
CollisionCallback?.Invoke(Entity, entity);
100-
entityPhysics.CollisionCallback?.Invoke(Entity, entity);
99+
CollisionCallback?.Invoke(entity);
100+
entityPhysics.CollisionCallback?.Invoke(Entity);
101101

102102
if (canGo)
103103
canGo = !(Solid && entityPhysics.Solid);

SharpEngine.Core/Manager/DebugManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static class DebugManager
2929
{
3030
{ "Raylib-cs", "8.0.0" },
3131
{ "ImGui.NET", "1.91.6.1" },
32-
{ "SharpEngine.Core", "2.5.4" }
32+
{ "SharpEngine.Core", "2.6.0" }
3333
};
3434

3535
/// <summary>

SharpEngine.Core/SharpEngine.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Copyright>Copyright (c) LavaPower 2021-2023</Copyright>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<PackageProjectUrl>https://github.com/SharpEngine/SharpEngine.Core</PackageProjectUrl>
12-
<PackageVersion>2.5.4</PackageVersion>
12+
<PackageVersion>2.6.0</PackageVersion>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<EnablePackageValisation>true</EnablePackageValisation>

0 commit comments

Comments
 (0)