From acea7b2e728787a0d83bbf83c8c1f042d2c32e7e Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 3 Jun 2024 10:15:45 +0800 Subject: + plugins project --- .../ISpaceAlgorithm.cs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Plugins/MonoGame.Extended/source/MonoGame.Extended.Collisions/ISpaceAlgorithm.cs (limited to 'Plugins/MonoGame.Extended/source/MonoGame.Extended.Collisions/ISpaceAlgorithm.cs') diff --git a/Plugins/MonoGame.Extended/source/MonoGame.Extended.Collisions/ISpaceAlgorithm.cs b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Collisions/ISpaceAlgorithm.cs new file mode 100644 index 0000000..a95f737 --- /dev/null +++ b/Plugins/MonoGame.Extended/source/MonoGame.Extended.Collisions/ISpaceAlgorithm.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; + +namespace MonoGame.Extended.Collisions; + +/// +/// Interface, which split space for optimization of collisions. +/// +public interface ISpaceAlgorithm +{ + /// + /// Inserts the actor into the space. + /// The actor will have its OnCollision called when collisions occur. + /// + /// Actor to insert. + void Insert(ICollisionActor actor); + + /// + /// Removes the actor into the space. + /// + /// Actor to remove. + bool Remove(ICollisionActor actor); + + /// + /// Removes the actor into the space. + /// The actor will have its OnCollision called when collisions occur. + /// + /// Actor to remove. + IEnumerable Query(RectangleF boundsBoundingRectangle); + + /// + /// for foreach + /// + /// + List.Enumerator GetEnumerator(); + + /// + /// Restructure the space with new positions. + /// + void Reset(); +} -- cgit v1.1-26-g67d0